Application level and Class level logging - change level on the fly ? | Community
Skip to main content
Level 3
October 16, 2015
Solved

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

  • October 16, 2015
  • 2 replies
  • 862 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by gopalKa

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.

2 replies

gopalKaAdobe EmployeeAccepted solution
Adobe Employee
October 16, 2015

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.

ashtrickAuthor
Level 3
October 16, 2015

Thanks Kalyanar for the information

Cheers,

-A