Develop a Spring MVC application (1) correction

xiaoxiao2021-03-06  100

In "Developing the Spring MVC Application (1)", due to the configuration of log4j, it has caused the log4j to work properly. Now the log4j is made as follows:

# For jboss: Avoid to setup log4j outside $ jboss_home / server / default / deploy / log4j.xml!

# For all other servers: Comment Out the log4j listener in web.xml too.

Log4j.rootlogger = info, stdout, logfile

?

Log4j.appender.stdout = org.apache.log4j.consoleAppender

Log4j.Appender.stdout.Layout = Org.apache.log4j.patternlayout

Log4j.Appender.stdout.Layout.conversionPattern =% D% p [% C] - <% m>% N

Log4j.Appender.logfile = org.apache.log4j.rollingfileappender

Log4j.Appender.logfile.file = Springapp.log

Log4j.Appender.logfile.maxfilesize = 512KB

# Keep Three Backup Files.

Log4j.Appender.logfile.maxbackupindex = 3

# Pattern to output: Date Priority [category] - Message

Log4j.Appender.logfile.Layout = org.apache.log4j.patternlayout

Log4j.Appender.logfile.Layout.conversionPattern =% D% p [% C] -% M% N

?

Remove the Third line of comments, specify the log file name as springapp.log and create this empty file in log4j.properties. The specific meaning of log4j.properties content can be referred to "

Log4J Log Management System Simple User Instructions "

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

New Post(0)