Question

How to delete Pega Logs older than 7 days?

Hi,

Greetings. I have a requirement to delete Pega logs older than 7 days. We are on Pega 7.3.1, i have written a cron job which deletes them but wanted to know if there is a Pega way of doing this?

Regards,

Bharat

**Moderation Team has archived post**

This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.

Correct Answer
November 19, 2018 - 9:59am

I am using Delete action within Log4j2 to delete logs older than 7d

Comments

Keep up to date on this post and subscribe to comments

November 2, 2018 - 8:04am

Hi,

 

You can use prlog4j2.xml(should be present in your service directory) to provide the log rolling instruction.

For time based roll off use TimeBasedTriggeringPolicy tag. Default value is one day.

For details please refer:

https://logging.apache.org/log4j/2.x/manual/appenders.html#RollingFileAppender

 

Thanks

Saikat

November 2, 2018 - 9:17am
Response to Saikatc8

Thanks Saikat, if i specify the interval as 7, will it delete all the logs older than 7? I wanted them to be deleted rather than rolled over.

Regards,
Bharat

November 19, 2018 - 9:59am

I am using Delete action within Log4j2 to delete logs older than 7d