WSO2 ESB log is too big, how to set?

爱⌒轻易说出口 提交于 2019-12-01 04:59:01

问题


I do a performance test on WSO2 ESB. And I found the log is too big that can not open. The biggest file is 7.20GB. I think this is a big problem. I want to set every log file less than 20MB, and I want delete old logs automatic. How to set this? Anyone can help me?


回答1:


You can configure logging in ESB_HOME/repository/conf/log4j.properties file.

Add following configurations in the log4j.appender.CARBON_LOGFILE=org.apache.log4j.RollingFileAppendersection.

log4j.appender.CARBON_LOGFILE.MaxFileSize=20MB
log4j.appender.CARBON_LOGFILE.MaxBackupIndex=1000

So this will ensure total 2MB * 1000 will be used. i. e first 1000 entries of 2MB chunks will be retained




回答2:


You can configure http_access_log by editing the catalina-server.xml which is located {CARBON_HOME}/repository/conf/tomcat directory and add renameOnRotate in the AccessLogValve

<Valve className="org.apache.catalina.valves.AccessLogValve" directory="${carbon.home}/repository/logs" renameOnRotate="true" prefix="http_access_" suffix=".log pattern="combined" />

Please refer [1] for more details

[1] - http://sparkletechthoughts.blogspot.com/2013/07/configure-access-logging-in-wso2.html



来源:https://stackoverflow.com/questions/13947211/wso2-esb-log-is-too-big-how-to-set

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