Fork me on GitHub
#timbre
<
2021-08-30
>
pieterbreed07:08:25

Hi everyone; is this channel active? Anyway - I was surprised to find that the logs produced from the JVM's uncaught exception handler thread does not honor the timbre configuration configured in the main thread and honorod by all the other threads. IE - I install a json appender which works on most threads, but the log statement in the uncaught exception handler uses the default timbre config. Is this something that I must fix? How can I apply the config in all threads?

Jan K10:08:36

@pieterbreed I haven't had that problem. Are you doing something like this?

(timbre/merge-config! ...) ; set timbre config
  (Thread/setDefaultUncaughtExceptionHandler
   (reify Thread$UncaughtExceptionHandler        
     (uncaughtException [_ thread ex]
       (timbre/error ex "Uncaught exception on thread" (.getName thread)))))

pieterbreed10:08:05

that's the essence of what I do yes.

Jan K10:08:07

That works for me, not sure what could be the problem 😞

pieterbreed10:08:27

I just reduced the code I run to the essence and it seems to work correctly. Like always it seems that my code is broken. Thanks for the prompt, if something interesting comes up, I'll report it here.