Fork me on GitHub

How do ya’ll do logging for your own code in duct? I see passing a logger as config to jetty server, for example, but what about your own stuff? Too heavy weight to pass in a logger, or is it worth the trouble.


We pass in the logger and use duct logging machinery (which uses timbre by default)


Good to know, will continue on that route.


I personally avoid timbre, and the duct logger… and take the traditional approach of just using with SLF4j redirecting everything (including ducts logger) over my backend. Whilst I’m sympathetic to duct’s purity ideals for logging, I want logs out of my dependencies too; and I’ve found it’s much less problematic to do things the java/logging way; and just use log4j2 to configure the logs and have the loggers initialised at startup outside of duct.


Yup, running into issues setting log level on apache/camel stuff from duct logger. I don’t have experience in java land handling log configuration, so 🤷


So, following up. I'm trying out threading a logger throughout code. I'm assuming it's a "code smell"


Here's a bit of config.edn              {:db     #ig/ref :duct.database.sql/hikaricp
                                                               :logger #ig/ref :duct/logger}

                        [:duct/daemon :watchdude.routes/init] {:ctx       #ig/ref :watchdude.camel/ctx
                                                               :db        #ig/ref :duct.database.sql/hikaricp
                                                               :id-graph  #ig/ref
                                                               :watch-dir #wd/prop ["" Str :or "c:/tmp/watchdude-watch-dir"]
                                                               :repo-dir  #wd/prop ["watchdude.repo.dir" Str :or "c:/tmp/watchdude-repo-dir"]
                                                               :logger    #ig/ref :duct/logger}
Internal to routes/init, I pass the db to a model. That model calls a function from the id-graph component. So assuming I should model these call dependencies explicitly in the config.


Sorry not sure what you’re asking.