Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Application level and Class level logging - change level on the fly ?

Avatar

Level 3

Hi All,

Is there a way to handle application level logging, ie, all logs from the application should be written to a specific log file and also the log level needs to be defined. We should be able to change the log level (INFO to DEBUG) when the application is running.

I know adding entry to Apache Sling Logging Logger Configuration will create logs and the log level can be manages as well. Is that the right way of doing it? Or this should be used to set logging for class level logs only?

Thanks

1 Accepted Solution

Avatar

Correct answer by
Employee

There is this Apache Sling Logging Configuration. This is the global configuration set up for the Sling OSGI  LogService implementation. you can change the log level here also.Please refer to http://sling.apache.org/documentation/development/logging.html for more information. But typically it is not a good practise to do this. Rather you can choose to change the logging at package/class level. Keep in mind that changing the log DEBUG will hugely affect the performance of a prod system.

View solution in original post

2 Replies

Avatar

Correct answer by
Employee

There is this Apache Sling Logging Configuration. This is the global configuration set up for the Sling OSGI  LogService implementation. you can change the log level here also.Please refer to http://sling.apache.org/documentation/development/logging.html for more information. But typically it is not a good practise to do this. Rather you can choose to change the logging at package/class level. Keep in mind that changing the log DEBUG will hugely affect the performance of a prod system.

Avatar

Level 3

Thanks Kalyanar for the information

Cheers,

-A