Overriding of default logger functionality to support min file size / daily rotation | Community
Skip to main content
binoyp6992037
Level 2
Jun 12, 2021 4:41 PM UTC
Solved

Overriding of default logger functionality to support min file size / daily rotation

Is there any way to have the logger support rotation in a way that it picks either min file size / daily rotation whichever comes first ?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Asutosh_Jena_
Asutosh_Jena_Accepted solution
New Participant
Jun 13, 2021 3:15 AM UTC

Hi @binoyp6992037 

 

The way sling logging is setup you could either use scheduled rotation or size based rotation, both can not be used simultaneously in a single configuration.

There are more details around the loggers in sling documentation here


The best practice per say:

  1. You need to have proper logging level set for the production instances so that the right amount of required logging happens, no noise is logged.
  2. For instances lower than production it makes more sense to have size based rotation as those logs are usually required for debug purposes so the amount of logging tends to increase if you use daily rotation. And it becomes difficult to process those huge files with normal text editors.

Thanks!

2 replies

Bhuwan_B
New Participant
Jun 13, 2021 2:35 PM UTC

@binoyp6992037 Please give a try by having two writer configuration for same logger file, one with scheduled configuration and another with size configuration.

 

https://www.youtube.com/watch?v=rwRozch4OYo

http://www.sgaemsolutions.com/2019/12/aem-logs-in-detail-part-2.html

 

Translate
Asutosh_Jena_
Asutosh_Jena_Accepted solution
New Participant
Jun 13, 2021 3:15 AM UTC

Hi @binoyp6992037 

 

The way sling logging is setup you could either use scheduled rotation or size based rotation, both can not be used simultaneously in a single configuration.

There are more details around the loggers in sling documentation here


The best practice per say:

  1. You need to have proper logging level set for the production instances so that the right amount of required logging happens, no noise is logged.
  2. For instances lower than production it makes more sense to have size based rotation as those logs are usually required for debug purposes so the amount of logging tends to increase if you use daily rotation. And it becomes difficult to process those huge files with normal text editors.

Thanks!

Translate