Expand my Community achievements bar.

SOLVED

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

Avatar

Level 2

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 ?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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!

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

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!

Avatar

Community Advisor

@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