Leiste mit Community-Erfolgen erweitern.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

Diese Konversation wurde aufgrund von Inaktivität geschlossen. Bitte erstellen Sie einen neuen Post.

GELÖST

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 Akzeptierte Lösung

Avatar

Korrekte Antwort von
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.

Lösung in ursprünglichem Beitrag anzeigen

2 Antworten

Avatar

Korrekte Antwort von
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