Slinglog - How to get file name of Logger | Adobe Higher Education
Skip to main content
Level 2
December 12, 2015
Répondu

Slinglog - How to get file name of Logger

Hi

I am trying to get the file name configured for the logger under /system/console/slinglog in my java application. for e.g. log.history is to mapped to "logs/history.log" so I want to get the "logs/history.log" if I provide "log.history"

Thanks in advance for taking time and helping! 

Thanks

Basheer

Ce sujet a été fermé aux réponses.
Meilleure réponse par joerghoh

Hi,

Use the configAdmin service and  do something like

configAdmin.listConfigurations("org.apache.sling.commons.log.LogManager.factory.config.*");

to find all log configurations. Then you have a logging configurations available in the system.

I haven't tested it, but it should work.

But: I cannot think of any reason, why you want to do it.

2 commentaires

joerghoh
Adobe Employee
joerghohAdobe EmployeeRéponse
Adobe Employee
December 13, 2015

Hi,

Use the configAdmin service and  do something like

configAdmin.listConfigurations("org.apache.sling.commons.log.LogManager.factory.config.*");

to find all log configurations. Then you have a logging configurations available in the system.

I haven't tested it, but it should work.

But: I cannot think of any reason, why you want to do it.

Level 2
December 14, 2015

Thanks for the response. I tried last night the same option and it worked. Filter string within listConfigurations method is little different as below.

configAdmin.listConfigurations("(service.pid=org.apache.sling.commons.log.LogManager.factory.config.*)")

The reason is why I want to do this is I am trying to read the history.log file for the events