Lazy way to convert log4j.xml to log4j2.xml

I've written a utility for converting XML to XML (log4j.xml to concise log4j2.xml). Using JAXB and FreeMarker, it makes a few assumptions about the input and doesn't support all features, but also saves comments assuming that the input file is reasonably formatted. It can hopefully be easily modified for your own requirements:

https://github.com/farnetto/log4jconverter


There is currently no tool to automatically convert log4j-1.x configurations to log4j2 configurations.

The log4j2 configuration is simpler however, and much, much better documented. The log4j2 manual provides lots of examples for the available lookups, appenders, layouts and filters.


I started writing a script to migrate simple use cases from log4j.properties to log4j2.xml. It is currently in a very early stage but can convert some simple configurations. It could be extended for similar log4j.xml configurations.

https://github.com/mulesoft-labs/log4j2-migrator