Log4j profile explanation

zhaozj2021-02-16  70

This is a database profile

# This is a configuration file instance, and the PropertyConfigurator will use this file: # 声明 An appender variable named jdbclog4j.rootlogger = debug, JDBC

#JDBC is a JDBCAPPENDER class, this class can write a message to the database log4j.Appender.jdbc = com.benqguru.palau.log.jdbc.test.jdbcappender

# 1. Connected database option log4j.Appender.jdbc.url = jdbc: mysql: // localhost: 3306 / logtelog4j.Appender.jdbc.userName = rootlog4j.Appender.jdbc.password =

# 2. Specify your own JDBCConnectionHandler's connector option log4j.Appender.jdbc.connection_class = com.benqguru.palau.log.jdbc.test.myConnectionHandler

# 3. Specify a SQL option for a static SQL statement, this statement will perform log4j.Appender.jdbc.sql = INSERT INTO LOGTEST (ID, MSG, CREATED_ON, CREATED_BY) VALUES (1, @ MSG @, sysdate, 'me')

# 4. Specify the table options for a table in the database. Log4j.Appender.jdbc.table = logtest

# 5. Column options for the description table (non-empty columns must be described) log4j.Appender.jdbc.columns = id_seq ~ empty ID ~ id ~ myidhandler msg ~ msg created_on ~ timestamp created_by ~ static ~ Thomas Fenner T.fenner@klopotek.de)

# 6. Define the layout option of the message layout (optional) log4j.Appender.jdbc.Layout = org.apache.log4j.patternLayoutLog4j.Appender.jdbc.Layout.ConversionPattern =% M

# 7. Define the size of the message event buffer (optional) log4j.Appender.jdbc.buffer_size = 1

# 8. Define the submission option (optional) log4j.Appender.jdbc.docommit = n

########## The following is English description ############# Date -% d {date} [SLF5s.date] #priority -% p [SLF5s.Priority] #Ndc -% x [slf5s.ndc] #thread -% T [SLF5s.thread] #category -% C [SLF5s.category] #Location -% L [SLF5s.Location] #MESSAGE -% M [SLF5s.MESSAGE] ## log4j.Appender.r.Layout.conversionPattern = [SLF5s.Start]% D {date} [SLF5s.date]% N / #% P [SLF5s.Priority]% N% x [SLF5s.NDC]% N% T [SLF5S.THREAD]% N / #% C [SLF5s.category]% N% L [SLF5S.LOCATION]% N% M [SLF5S.MESSAGE]% n% n ########## It is Chinese description ######################################################### Output the LOG information takes a few #% C to output the category belonging, which is usually the full name #% t output of the class generated to generate the thread name #% n output of the log event, and the Windows platform is "/ R / N ", the Unix platform is" / n "#% D output log time point date or time, the default format is ISO8601, or it can be specified in the format, # such as% D {YYY MMM DD HH: mm: SS, SSS}, Output Similar: October 18, 2002 22:10: 28,921 #% l Output log events, including category names, threads that occur, and number of rows in code. Example: Testlog4.main (Testlog4.java: 10) This is a normal profile

# log4j will parse this file log4j.debug = false # temporarily unclear the role of these two attributes log4j.disableOverride = truelog4j.disable = info # Settings Record All class logs Log4j.Rootlogger = Debug, dest1, dest2 # Set this package record log as a fake word # dist1, dist2 will not record the log of com.benqguru.commons.logging.test.loggingSample, only DIST3 will record. #Inti, will record, this will repeat log4j.additivity .com.benqguru.commons.logging.test.loggingsample = false # Special specified a particular package log level and target device log4j.category.com.benqguru.commons.logging.test.loggingSample = WARN, DEST3 # This target device for debuglog4j.appender.dest1 = org.apache.log4j.ConsoleAppender # log4j.appender.dest1.layout = org.apache.log4j.SimpleLayoutlog4j.appender.dest1.layout = org.apache.log4j.PatternLayout #% - 4r% -5P [% T]% 37C% 3X -% m% NLOG4J.APPENDER.DEST1.LAYOUT.CONVERSIONPATTERN =% D% P% C - <% m> (% F.% M:% L)% T% N

# This target device is used to traceLog4j.Appender.Dest2 = org.apache.log4j.rollingFileAppender # The level of the file log log (INFO is not recorded) log4j.Appender.Dest2.threshold = info # file save path log4j.Appender .dest2.file = C: /LOG4JLOG.HTM# Whether to add information log4j.Appender.Dest2.append = true # Settings file maximum log4j.Appender.Dest2.maxFileSize = 5kb # Set the maximum number of backup files log4j.Appender .dest2.maxbackupindex = 10 # Using an HTML format to record log log4j.Appender.Dest2.Layout = org.apache.log4j.htmlLayout # Log4j.Appender.Dest2.LAYout.LocationInfo = true # set The log's HTML title log4j.Appender.Dest2.Layout.Title = My App Title # This target device is used to specify the class or package log4j.Appender.Dest3 = org.apache.log4j.dailyrollingFileAppender # log4j.Appender.Dest3. Threshold = DEBUGlog4j.appender.dest3.File = c: /SpecPackageLog.htmlog4j.appender.dest3.Append=falselog4j.appender.dest3.layout=org.apache.log4j.HTMLLayoutlog4j.appender.dest3.layout.LocationInfo=truelog4j.appender .dest3.Layout.title = my App Title

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

New Post(0)