Logs for web applications by configuring log4j.xml under jboss

xiaoxiao2021-03-06  22

Log4j is an excellent open source Java log system, and the JBoss is also integrated. The default is only a daily log for Server under JBoss, and there is no daily log building for your deployment, but we can pass Modify the log4j.xml file to implement. Log4j.xml file Open Log4j.xml file under Server / Default / Conf in the JBoss installation directory

This is the default configuration of the log4j, let's get familiar with it! - ===================================== -> < ! - Threshold is a global filter that will filter the information below the set of Level is not displayed ->

Parameters Different parameters after getting different parameters represent different formatted information (parameters are listed in alphabetic order) :% C outputs the full name of the class belong, can be modified to% D {Num}, the NUM class name output is as follows: "org.apache.ely.classname",% c {2} will output Elathen.ClassName% D Output log Time The format is% D {YYYY-MM-DD HH: MM: SS, SSS}, can specify a format as% D {HH: mm: SS}% L Output log event occurs, including class name, occur Thread, the number of row of rows in the code, the number of lines, such as INFO ("Message), output Message% P, which is Fatal, Error and other% R output from start to display the log information The millisecond% T outputs the thread name "of the log event"! - the default pattern: Date Priority [category] message / n -> < appender name = "file" c Lass = "org.jboss.logging.Appender.dailyRollingFileAppender"> <

! - rollover at the top of each hour -> -> The default configuration of Log4j under jboss, logs log record for JBoss, next to us add the log of the web project, put the following configuration in the log4j.xml file Information plus it can

< / layout>

转载请注明原文地址:https://www.9cbs.com/read-67821.html

New Post(0)