Get log4j Loggers

Which IIQ version are you inquiring about?

Version 8.X

Share all details related to your problem, including any error messages you may have received.

I am trying to create code which needs to know what are the logger classes are available in IIQ. Anyone have any idea how can I get list of all loggers registered in IIQ? Second option would be to get list of all loaded classes and check if loggers for them are configured but it’s also not too simple task without Java Agent.

Hi Kamil

Try this:

final LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
Collection<Logger> loggers = ctx.getLoggers();

Hi Alek,
Just tested your solution and it works perfectly - thanks

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.