简体   繁体   English

WSO2 ESB日志太大了,怎么设置?

[英]WSO2 ESB log is too big, how to set?

I do a performance test on WSO2 ESB. 我在WSO2 ESB上进行了性能测试。 And I found the log is too big that can not open. 我发现日志太大而无法打开。 The biggest file is 7.20GB. 最大的文件是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. 我想将每个日志文件设置为小于20MB,我想自动删除旧日志。 How to set this? 怎么设置这个? Anyone can help me? 有人可以帮帮我吗? 在此输入图像描述

You can configure logging in ESB_HOME/repository/conf/log4j.properties file. 您可以在ESB_HOME / repository / conf / log4j.properties文件中配置日志记录。

Add following configurations in the log4j.appender.CARBON_LOGFILE=org.apache.log4j.RollingFileAppender section. log4j.appender.CARBON_LOGFILE=org.apache.log4j.RollingFileAppender部分中添加以下配置。

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

So this will ensure total 2MB * 1000 will be used. 因此,这将确保使用总共2MB * 1000。 i. 一世。 e first 1000 entries of 2MB chunks will be retained e将保留前1000个2MB块的条目

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 您可以通过编辑位于{CARBON_HOME} / repository / conf / tomcat目录的catalina-server.xml来配置http_access_log,并在AccessLogValve中添加renameOnRotate

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

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM