1 Learning Configuration Log4j
On Tomcat and JBOSS, the configuration is not very different. details as follows:
Under Tomcat, connect Log4j.Properties or log4j.xml directly under the Classes of the deploy program, you can use the specific Appender, such as file, console, SMTP, etc., directly correspond to the class to operate.
Under JBoss, since JBoss takes over the log4j system itself, if you want to correctly record log, you need to configure JBoss's own log4j.xml file, or take over JBoss's log system, replace the LOG4J of JBoss with its own log4j configuration file. xml
Specifically, for example, add the following code in the Log4j.xml file of JBoss:
->
->
layout>
appender>
Value =
www@xxx.com/>
Value = xxx
@ xxx.com />
layout>
appender>
category>
category>
Current question:
1 How to generate a format file, for example: xxxx_20050420.log
2 SMTPAPPENDER mode, when SMTP server requires authentication, how to set parameters?