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

Avatar

Avatar
Validate 1
Level 1
binoyp6992037
Level 1

Likes

0 likes

Total Posts

9 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Give Back
View profile

Avatar
Validate 1
Level 1
binoyp6992037
Level 1

Likes

0 likes

Total Posts

9 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Give Back
View profile
binoyp6992037
Level 1

12-06-2021

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 ?

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Applaud 25
Level 10
asutosh_jena
Level 10

Likes

593 likes

Total Posts

705 posts

Correct reply

207 solutions
Top badges earned
Applaud 25
Give Back 100
Boost 500
Affirm 100
Ignite 1
View profile

Avatar
Applaud 25
Level 10
asutosh_jena
Level 10

Likes

593 likes

Total Posts

705 posts

Correct reply

207 solutions
Top badges earned
Applaud 25
Give Back 100
Boost 500
Affirm 100
Ignite 1
View profile
asutosh_jena
Level 10

12-06-2021

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!

Answers (1)

Answers (1)

Avatar

Avatar
Validate 1
Level 6
Bhuwan_B
Level 6

Likes

133 likes

Total Posts

125 posts

Correct reply

50 solutions
Top badges earned
Validate 1
Affirm 50
Give Back 5
Boost 100
Give Back 3
View profile

Avatar
Validate 1
Level 6
Bhuwan_B
Level 6

Likes

133 likes

Total Posts

125 posts

Correct reply

50 solutions
Top badges earned
Validate 1
Affirm 50
Give Back 5
Boost 100
Give Back 3
View profile
Bhuwan_B
Level 6

13-06-2021

@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