Janier
Janier

Reputation: 4432

how to delete logs in wso2 api manager periodically

I am using a combination of WSO2 API Manager and Identity server. Now my server machine gets full because of logs. Though logs getting rotated , they are not being deleted. Is there a way to manage logs in WSO2? May be automatically delete them after a time period. Or limit the size if logs file

Upvotes: 1

Views: 1301

Answers (1)

Bee
Bee

Reputation: 12513

You can configure logging in 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 20MB * 1000 will be used. i. e first 1000 entries of 20MB chunks will be retained

Ref: WSO2 ESB log is too big, how to set?

Upvotes: 1

Related Questions