|
|
Olivier Jaquemet -
on 2/10/06 at 12:11 PM
No.
Appenders are ways of outputting logging events using log4j.
The <appender...> tag is where you define those appenders.
For example, in the default log4j.xml file of JCMS, we define two appenders: "CONSOLE", and "LOGFILE", which respectively output to the java console and to the jcms log file (WEB-INF/data/logs/jcms.log).
Once appenders have been declared, we can use/reference them in the loggers using the <appender-ref...> tag.
That's what we do in the main declaration of the loggers:
<logger name="com.jalios">
<level value="INFO" />
<appender-ref ref="CONSOLE" />
<appender-ref ref="LOGFILE" />
</logger>
But because appenders are inherited in the loggers hierarchy, you only need to precise them once.
For example, if you have defined the main logger hierarchy "com.cohen" with the appenders CONSOLE and LOGFILE with the logging level INFO:
<logger name="com.cohen">
<level value="INFO" />
<appender-ref ref="CONSOLE" />
<appender-ref ref="LOGFILE" />
</logger>
And that you just want MyController logger to have the DEBUG logging level, you just need to precise this afterwards:
<logger name="com.cohen.MyController">
<level value="DEBUG" />
</logger>
|
|