lein-ring icon indicating copy to clipboard operation
lein-ring copied to clipboard

Running lein ring server headless, ignores resources/log4j.properties

Open sindhubb opened this issue 3 years ago • 1 comments

I have a resources/log4j.properties file which is honoured when I run my app as java -jar... but when I run my app through lein ring as lein ring server-headless 3334, I keep seeing the log level as INFO. How can I get lein ring to honour my log4j.properties file?

$ DEVMODE=1 JAVA_OPTS=-Xmx500m lein ring server-headless 3334
22-08-09 09:52:57 Sindhus-MacBook-Air.local INFO [org.eclipse.jetty.util.log:186] - Logging initialized @1300ms
22-08-09 09:53:00 Sindhus-MacBook-Air.local INFO [com.mchange.v2.log.MLog:203] - MLog clients using slf4j logging.
22-08-09 09:53:00 Sindhus-MacBook-Air.local INFO [com.mchange.v2.c3p0.C3P0Registry:203] - Initializing c3p0-0.9.5-pre9 [built 08-October-2014 03:06:08 -0700; debug? true; trace: 10]
WARNING: uri? already refers to: #'clojure.core/uri? in namespace: schema-contrib.core, being replaced by: #'schema-contrib.core/uri?
"***** Initializing Database settings ***** "
"***** Hello Dev! ***** "
22-08-09 09:53:02 Sindhus-MacBook-Air.local INFO [org.eclipse.jetty.server.Server:327] - jetty-9.2.21.v20170120
22-08-09 09:53:02 Sindhus-MacBook-Air.local INFO [org.eclipse.jetty.server.ServerConnector:266] - Started ServerConnector@f3e6e05{HTTP/1.1}{0.0.0.0:3334}
22-08-09 09:53:02 Sindhus-MacBook-Air.local INFO [org.eclipse.jetty.server.Server:379] - Started @6342ms
Started server on port 3334

resources/log4j.properties

log4j.logger.com.mchange.v2=FINE
log4j.category.org.eclipse.jetty=DEBUG

sindhubb avatar Aug 09 '22 10:08 sindhubb

Potentially this is an issue stemming from the use of Leiningen's eval-in-project. I'm unsure how to work around this, but I welcome any investigation or patches people want to contribute toward solving this.

weavejester avatar Aug 09 '22 16:08 weavejester