Script to convert log4j.properties to log4j.xml

后端 未结 4 1134
忘了有多久
忘了有多久 2021-01-17 10:16

I need to use custom filters, so I need to convert some long log4j.properties files to log4j.xml.

Is anyone aware of a tool to do this, or willing to contribute one

4条回答
  •  渐次进展
    2021-01-17 11:05

    Recently used https://github.com/balent/Log4j-Convert-Configuration to convert a log4j.xml file to a log4j.properties file (an ancient jar I had to use was explicitly looking for log4j.properties). The configuration allows going both ways: xml to properties OR properties to xml.

    Download the binary build from https://github.com/balent/Log4j-Convert-Configuration/blob/master/binaries/full-with-dependencies/log4j-convert-full.jar and then just type:

    java -jar log4j-convert-full.jar -i log4j.properties -o log4j.xml
    

    Leaving this on here for future me to find.

提交回复
热议问题