table of Contents
Background article
When the debugger log output suddenly found some positions are not set up, but finally is solved!
table of Contents
Questions introduced
Locally run time environment is as follows:
windows10 Chinese, tomcat9, java1.8, java web program
Before the program which is System.out.println();
in the form of logs, in order to facilitate the positioning, on the use of log4j rewrite some of it.
Because more work, there is no completely rewritten, but later found rewrite the location and did not find the log output.
That is the configuration file content issues, but after the normal controls found with online still can not be solved.
Recently the present profile of console output configured as follows:
log4j.rootLogger=ALL,console
log4j.appender.console = org.apache.log4j.ConsoleAppender
log4j.appender.console.Target = System.out
log4j.appender.console.layout = org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern = %d %p [%c] - %m%n
problem solved
Occasionally try, to be renamed before log4j.cfg become log4j.properties, and then discovered that there was a success, do not know the specifics of the case, go back there time to study study.
At least former general procedure which can be normally recognized. So it's not concerned about the format, but the good news is finally resolved.
As for the other log output, you can add the needed.
Explanation
Welcome comment, please correct me, reprint please indicate the source.
Reference article
Use takeover tomcat log4j log catalina.out - Ambitions place ......... - CSDN blog
https://blog.csdn.net/yucaifu1989/article/details/78673132
Tomcat logging, log4j log entries in the console - my last log in the end where to run? - Ono Dad's blog - CSDN blog
https://blog.csdn.net/lihongjing/article/details/79358498
Version History
20,190,605 solve the problem
20190605 complete article