log4j2-in-tomcat
log4j2-in-tomcat copied to clipboard
Logs such as System.out after log4j2-tomcat.xml are configured can only be output in localhost.xxxx-XX-xx.log
I have a log4j2-tomcat.xml file, which is based on your article and the Github project. It works exactly the same and can generate a file every day, but the System.out logs are all printed to localhost.2019-09- 12.log file, this is not what I want. I tried to modify the log4j2-tomcat.xml file, and referenced the log4j2 document and other blog related configuration, it does not take effect, can I output the log such as System.out Go to the place I want and modify the file name instead of just printing it to the localhost.2019-09-12.log file. I look forward to hearing from you, thank you very much. September 12, 2019.
Tomcat 9.0.20 log4j2 2.12.1
Hello @xiaonanhailili ,
Glad to hear that the repo is kind of useful :+1:
mmm, :thinking: , in the provided configuration there is no LOCALHOST appender, so that file should not exist. Can you share with me your current log4j2-tomcat.xml?
Regarding the System.out, I am not sure what you want to achieve. In my case I want to keep the catalina.out (standard output of the tomcat/docker process) in this case as cleaner as possible.
Hope it helps,
Luis
Hello, Luis,Thank you for your reply. I am uploading my entire Tomcat package to Github, I am in China, uploading is very slow, please forgive me.
log4j2-tomcat.txt This is my log4j2-tomcat.xml:
I put my Tomcat environment here. https://github.com/xiaonanhailili/tomcat_backup That is compressed in 7z format. I hope to help you understand my mistakes.
Regarding the System.out, I am not sure what you want to achieve. In my case I want to keep the catalina.out (standard output of the tomcat/docker process) in this case as cleaner as possible.
Keeping it clean is also what I hope. But I think the log output to the localhost file is incorrect. I want to output it to the tomcat9-stdout file or I can customize a file. That's great.
Hello @xiaonanhailili
May I ask you to remove your conf/logging.properties and give it a try?
Hope it helps,
Luis
hello @lurodrig yes, I can try again and give you feedback. I have tried to do this, after which the local host file will not be generated.
plum
hello,Luis @lurodrig I am trying to delete CONF / logging.properties This is feedback
This problem has plagued me for a day. I have been trying to find a solution, but I have not succeeded, so I will ask you if you have encountered such a situation.