Logarithmic data printing several times

I have implemented my own log file using log4j for my web application. But the problem is that when I print any thing in this log file, it prints several times. Is there a loop or some iteration in the code? Can someone help me deal with this issue.

+3
source share
4 answers

From: http://www.jajakarta.org/log4j/jakarta-log4j-1.1.3/docs/TROUBLESHOOT.html

Duplicates log4j in output.

log4j ( ), , , .

log4j . , appender n , appender n , .

, - . BasicConfigurator.configure() . , , appender System.out .

, , . , , A, , A . , A , C, C , , A , C.

+6

- Logger . , LOG4J :

log4j.logger.com.example = ERROR, out
log4j.logger.com.example.myapp = INFO, out

, com.example.myapp.MyClass , .

, Addender Additive, :

log4j.additivity.com.example.myapp = false

. http://logging.apache.org/log4j/1.2/manual.html#additivity.

+2

- java , ( ) .

0

, , log4j, .. log4j.xml log4j.properties. , - .

, , .

0

All Articles