log4j - How to turn off Spring 3 debug logging? -
i turn off log4j logging spring 3.1 while leaving things on debug own code.
i tried sticking line log4j.properties:
log4j.category.org.springframework = warn to this:
# root logger setup: includes level of reporting , appenders -> # log messages sent log4j.rootlogger = debug,ca,fa log4j.category.org.springframework = warn #ca - console appender - send messages console log4j.appender.ca = org.apache.log4j.consoleappender log4j.appender.ca.layout = org.apache.log4j.patternlayout log4j.appender.ca.layout.conversionpattern = [acme]: [%-5p] - %d{yyyy-mmm-dd hh:mm:ss} - %c{1}:%m(): %m%n #fa - file appender - send messages log file log4j.appender.fa = org.apache.log4j.rollingfileappender log4j.appender.fa.file = acme.log log4j.appender.fa.maxfilesize = 100kb log4j.appender.fa.maxbackupindex = 10 log4j.appender.fa.threshold = debug log4j.appender.fa.layout = org.apache.log4j.patternlayout log4j.appender.fa.layout.conversionpattern = [%-5p] - %d{yyyy-mmm-dd hh:mm:ss} - %c{2}:%m(): %m%n no luck in shutting off debug output spring though.
thanks in advance help
steve
are dependencies in place?
1.3.2.3 using log4j
many people use log4j logging framework configuration , management purposes. it's efficient , well-established, , in fact it's use @ runtime when build , test spring. spring provides utilities configuring , initializing log4j, has optional compile-time dependency on log4j in modules.
to make log4j work default jcl dependency (commons-logging) need put log4j on classpath, , provide configuration file (log4j.properties or log4j.xml in root of classpath). maven users dependency declaration:
<dependencies> <dependency> <groupid>org.springframework</groupid> <artifactid>spring-context</artifactid> <version>3.0.0.release</version> <scope>runtime</scope> </dependency> <dependency> <groupid>log4j</groupid> <artifactid>log4j</artifactid> <version>1.2.14</version> <scope>runtime</scope> </dependency> </dependencies> and here's sample log4j.properties logging console:
log4j.rootcategory=info, stdout log4j.appender.stdout=org.apache.log4j.consoleappender log4j.appender.stdout.layout=org.apache.log4j.patternlayout log4j.appender.stdout.layout.conversionpattern=%d{absolute} %5p %t %c{2}:%l - %m%n log4j.category.org.springframework.beans.factory=debug
Comments
Post a Comment