Fork me on GitHub
#ring
<
2023-06-06
>
conan14:06:03

I'm having trouble with Jetty logging using ring-jetty-adapter, I can't figure out how to change it. My application uses timbre and slf4j, but configuring timbre doesn't affect jetty logging at all, despite jetty announcing that it's using slf4j on startup. I'd really like to change the colour so INFO messages don't log in red, to change the format to match my other log messages, and possibly even raise the jetty log level to WARN I've tried everything in the jetty docs including adding a jetty-logging.properties to my classpath, but that also didn't do anything. Anyone know how to configure jetty logging in a ring application? (I also have the same problem with migratus)

🥴 2
Eugen08:06:09

I think you should be aware about logging in Web apps. I think logging implememtation is loaded by servlet containers and Web apps should just use the API.

Eugen08:06:33

Webb apps in java are done with some class path magic

Eugen08:06:33

not sure how it translates to ring -since that I not q web qpp qctually

Eugen08:06:50

timbre is also a logging implementation not a logging facade

Eugen08:06:32

so you might have 2 logging implementations there

Eugen08:06:07

it should work if you use clojure tools logging . that should pick-up slf4j implementation from jetty and you cand then configure it via jetty properties

Eugen08:06:05

we stopped using timbre because of this issue. we use libraries with different implementations. timbre, to my knowledge is also an implementation qnd you can't quite mix and match. we tried https://github.com/fzakaria/slf4j-timbre but it has a bug or two and we decided to use tools logging facade with slf4j implementation (amperity/dialog)

conan09:06:20

Thanks! Timbre is excellent for our code, but you're right - it doesn't play very well with the java ecosystem that inevitably creeps in!