rewrite-logging-frameworks icon indicating copy to clipboard operation
rewrite-logging-frameworks copied to clipboard

Logging Configuration File Conversion Recipe

Open rdifrango opened this issue 3 years ago • 3 comments
trafficstars

It would be great if there was a Recipe to convert between things like log4j.properties or log4j.xml to logback.xml etc.

rdifrango avatar Dec 20 '21 01:12 rdifrango

I agree, and I think this should be kept open. For the time being, it's not currently being prioritized. In the mean time, there are other products which can handle the migration from things like log4j.properties to log4j.xml:

  • https://github.com/jroyals/log4j-properties-converter
  • http://log4j-props2xml.appspot.com/

(Granted, it means there's an additional step that has to be done, and it'd be better if the recipe handled these things as well-- but having those tools is better than nothing / doing everything by hand 🤷 )

aegershman avatar Jan 12 '22 18:01 aegershman

The note on those converters as it only goes from log4j.properties to log4j.xml and not logback.xml . Now logback does have an online converter which can be found here:

https://logback.qos.ch/translator/

BTW, I totally respect it not being on the backlog.

rdifrango avatar Jan 12 '22 19:01 rdifrango

There is an official Log4j1ConfigurationConverter in log4j-1.2-api that can be called from code.

It is less powerful than the new pluggable PropertiesConfigurationFactory used by log4j-1.2-api itself, but it should cover the log4j.properties configuration format and all the components in log4j:log4j.

ppkarwasz avatar Dec 27 '23 10:12 ppkarwasz