Plugin level / Csutom logging with Lo4J2 configuration

Is it possible to have a plugin level Lo4J2 configuration with Openfire version > 4.5.4 ?

Earlier our plugins packaged with log4j(1.2.17) with log4j.xml configuration file and all good with custom logging.

With recent Log4J vulnerability we want upgrade Log4J to log4j2(2.17.1). Core & API libs supported by log4j2.xml. This approach is not generation log files.

Required log files created when /lib/log4j2.xml file is appended with plugin required log appenders.

Has anyone able to package a plugin with its own log4j2.xml configuration file ? Is it possible ?

Wouldn’t it be a lot easier to simply use the log4j2 instance that is provided by Openfire - or better yet, use SLF4J and need not worry about the logging framework that’s provided at runtime?

Trying to limit it to plugin’s scope for maintenance for various logging, troubleshooting etc. May be will consider switching to SLF4J log framework. Thank you Guss.

Thought it would be easy with Log4j bridge API(no code changes :slightly_smiling_face: ) and just the configuration file. Remember encountering similar situation with OF3.8.0 then we made the programmatical log file creation.

Instead of adding to the technical debt, by writing customizations to force things in place, my guess is that you’re better of with resolving the technical debt completely. It probably takes roughly as much effort, and will at the same time prevent future issues.

1 Like