Slinglog - How to get file name of Logger | Community
Skip to main content
Level 2
December 12, 2015
Solved

Slinglog - How to get file name of Logger

  • December 12, 2015
  • 2 replies
  • 934 views

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

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 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 replies

joerghoh
Adobe Employee
joerghohAdobe EmployeeAccepted solution
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