How To Setup Logback with Tomcat 6 on Windows

限于喜欢 提交于 2019-12-20 05:39:27

问题


I have tomcat6 installed on my Windows desktop for testing purpose. At the moment nothing is added to the webapps folder, just the normal tomcat start up. Following log files are produced:

catalina.2011-12-24.log
host-manager.2011-12-24.log
jakarta_service_20111224.log
localhost.2011-12-24.log
manager.2011-12-24.log
stderr_20111224.log
stdout_20111224.log

My problem is simple, I want these logs [stdout included] to be rolled and compressed on the basis of defined size limit.

I have read about logback and its capabilities to roll and compress files with defined policies, but I have not been able to make it work for me. I have copied following jars in $TOMCAT_HOME/lib directory:

logback-access-1.0.0.jar
logback-classic-1.0.0.jar
logback-core-1.0.0.jar

Some sites suggested these libs should be added as well:

jul-to-slf4j-1.6.4.jar
slf4j-api-1.6.4.jar

I have tried copying logback.xml in $TOMCAT_HOME/conf and $TOMCAT_HOME/lib, but unable to make it work.

I would really appreciate if someone can help me with this, best could provide me with a logback.xml and jars/xml location where these files should be copied to make it work.

P.S. I have not deployed any webapp in the tomcat, it just the basic tomcat setup.


回答1:


I think this tutorial can help. Tomcat 6 works only with log....0.9.30.jar or lower. Tomcat + SLF4J + Logback



来源:https://stackoverflow.com/questions/8620848/how-to-setup-logback-with-tomcat-6-on-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!