ring

conan 2023-06-06T14:44:03.809499Z

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)

🥴 1
Eugen 2023-06-11T08:13:09.352919Z

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.

Eugen 2023-06-11T08:13:33.461259Z

Webb apps in java are done with some class path magic

Eugen 2023-06-11T08:14:33.329129Z

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

Eugen 2023-06-11T08:20:04.989669Z

WAR

Eugen 2023-06-11T08:20:50.775079Z

timbre is also a logging implementation not a logging facade

Eugen 2023-06-11T08:21:32.330379Z

so you might have 2 logging implementations there

Eugen 2023-06-11T08:24:07.857139Z

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

Eugen 2023-06-11T08:28:05.960619Z

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)

conan 2023-06-15T09:39:20.692459Z

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!