Is there any way to silence the jetty used by Figwheel Main? I have a serious problem with it since I have a following combo in use: • Figwheel Main • Timbre • Timbre's slf4j adapter
Now if I execute for example lein run -m figwheel.main -co test.cljs.edn -m my-runner
it will end up starting Jetty under the hood so that it can do it's magic
BUT since I have both Timbre and it's slf4j adapter which get loaded during classload (since that's just it has to be done with java logging stuff) and Timbre defaults to :debug
level (like pretty much all loggers) this will end up putting Jetty to debug level which causes shitton of log
Just executed a build, caused 20877 lines of logs
all lines from org.eclipse.jetty
These are the only solutions I've came up with so far to remedy this problem: 1) Use env variable and set logging level through that. This is a bad solution though since it is totally dependent on the system which is executing the command. I would want to avoid this as long as possible 2) Write a separate Leiningen plugin which calls Figwheel Main under the hood AND allows silencing Jetty before starting it
i'd have thought you could blacklist the jetty namespaces using timbre's configuration https://github.com/ptaoussanis/timbre#configuration
you can blacklist specific namespaces, e.g.
:ns-blacklist ["*jetty.*"]
(or something like that)
you can add that into timbre dynamically with timbre/merge-config!
, something like
(timbre/merge-config! {:ns-blacklist ["*.jetty.*"]})
maybe give that a shot? note that you can actually write your own appender functions to filter messages (or do anything else), so you could drop in a function that says "if it's jetty and doesn't include the word Exception then ignore"
Sorry that I didn't respond earlier. I did naturally try the blacklisting. The problem here is, that the logging happens without me having any control over the logging configurations. I ended up "fixing" this problem by including the slf4j adapter only in uberjar profile
Both solutions are very much not what I want
Made an issue out of this https://github.com/bhauman/figwheel-main/issues/162