java - Problem with log4j xml configuration -
I have a little question, my log4j.xml configuration is listed below
& lt; ? XML version = "1.0" encoding = "UTF-8"? & Gt; & Lt ;! DOCTYPE log4j: Configuration system "log4j.dtd" & gt; & Lt; Log4j: Configuration xmlns: log4j = "http://jakarta.apache.org/log4j/" & gt; & Lt; Appender Name = "console" class = "org.apache.log4j.ConsoleAppender" & gt; & Lt; Param name = "target" value = "system.out" /> & Lt; Layout class = "org.apache.log4j.PatternLayout" & gt; & Lt; Param name = "ConversionPattern" value = "% - 5p% c {1} -% m% n" /> & Lt; / Layout & gt; & Lt; / Appender & gt; & Lt; Name of Logger = "Com. LL.D.E.P." & gt; & Lt; Level value = "info" /> & Lt; Epander-reef ref = "console" /> & Lt; / Logger & gt; & Lt; Name of the logger = "org.springframework" & gt; & Lt; Level value = "error" /> & Lt; Epander-reef ref = "console" /> & Lt; / Logger & gt; & Lt; Root & gt; & Lt; Priority value = "error" /> & Lt; Epander-reef ref = "console" /> & Lt; / Root & gt; & Lt; / Log4j: Configuration & gt; And when I call a log.info ("some information") inside the com.alsodeep package, for example
INFO aspect example - Call it before method method As an example - Call it before method Hello INFO aspect example - Call it method information after aspect - Example method list [[23, 243, 234, 23432]] App app - Last info App - last I'm confused with it, what's wrong in my log4j settings?
PS When I remove the epiderm from the root element, everything is fine and my log information only appears once.
Remove:
& lt; Appender-ref ref = "console" / & gt; with special logger and just leave one in the root logger:
& Lt; Layout class = "org.apache.log4j.PatternLayout" & gt; & Lt; Param name = "ConversionPattern" value = "% - 5p% c {1} -% m% n" /> & Lt; / Layout & gt; & Lt; / Appender & gt; & Lt; Name of Logger = "Com. LL.D.E.P." & gt; & Lt; Level value = "info" /> & Lt; / Logger & gt; & Lt; Name of the logger = "org.springframework" & gt; & Lt; Level value = "error" /> & Lt; / Logger & gt; & Lt; Root & gt; & Lt; Priority value = "error" /> & Lt; Epander-reef ref = "console" /> & Lt; / Root & gt; & Lt; / Log4j: Configuration & gt; Your configuration is valid, however, when you try to log in to com.alsodeep , then this appendix for appenders directly connected to this logger Gets up and then promotes up com does not have any associated affiliates, but in the root (parents of all loggers) it is coincidentally this is the same console appender, so it is added twice is.
Comments
Post a Comment