# Help with logging in Scotty handlers

**URL:** <https://discourse.haskell.org/t/help-with-logging-in-scotty-handlers/1768>\
**Category:** Learn\
**Created:** [January 11, 2021, 11:01am UTC](https://discourse.haskell.org/t/help-with-logging-in-scotty-handlers/1768 "2021-01-11T11:01:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fbrs](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/fbrs/32/1057_2.png) [@fbrs](https://discourse.haskell.org/u/fbrs)\
**Post date:** [January 11, 2021, 11:01am UTC](https://discourse.haskell.org/t/help-with-logging-in-scotty-handlers/1768/1 "2021-01-11T11:01:50Z")

</div>

I’m comparing logging libraries and I’m stuck with `co-log`. I already asked on [StackOverflow](https://stackoverflow.com/questions/65599741/how-to-make-co-logs-withlog-work-with-scotty) but so far got no replies.

In short: I don’t know how to create an instance for `co-log` so I can use `withLog` in a handler in the same way I’m doing it [for `katip`](https://www.reddit.com/r/haskell/comments/jyzc3w/how_to_avoid_infinite_type_when_lifting/)

I created a repository `https://github.com/cideM/co_log_issue` where you can see the issue. I would have preferred this as a single file with a Nix shebang line but at the time of writing `co-log` was broken in Nixpkgs. I have since fixed this and will check if I can now just provide a single file.

In the meantime though… any ideas? This problem means I just can’t use `co-log` here at all, since without being able to modify the logger for a given scope I miss out on the `co-log` equivalent of namespaces and contexts.

(Couldn’t make all of the URLs proper links since new users can only include 2 links)
