log4j-properties-converter icon indicating copy to clipboard operation
log4j-properties-converter copied to clipboard

Converting file without rootLogger fails

Open SamyaDaleh opened this issue 6 years ago • 0 comments

I tried to use the online converter for one of my files. It showed a throbber for several minutes before I lost patience and tried it with a different browser, same result. Then I downloaded the distribution. The command line tool gave me this NPE:

Exception in thread "main" java.lang.NullPointerException
        at com.fragstealers.log4j.func.LoggerConfigFunction.apply(LoggerConfigFunction.java:51)
        at com.fragstealers.log4j.core.Log4JModel.getRootLogger(Log4JModel.java:92)
        at com.fragstealers.log4j.jaxb.JaxbLog4JPropertiesConverter.toXml(JaxbLog4JPropertiesConverter.java:51)
        at com.fragstealers.log4j.ui.cli.CommandLineUI.doConvert(CommandLineUI.java:81)
        at com.fragstealers.log4j.ui.cli.CommandLineUI.showUi(CommandLineUI.java:57)
        at com.fragstealers.log4j.ui.cli.CommandLineUI.main(CommandLineUI.java:44)

I managed to get the tool to work by adding a log4j.rootLogger=INFO, file to my properties file.

This is my file:

log4j.rootCategory=info, system
log4j.appender.system=org.apache.log4j.DailyRollingFileAppender
log4j.appender.system.encoding=UTF-8
log4j.appender.system.DatePattern='.'yyyyMMdd
log4j.appender.system.File=../logs/startup.log
log4j.appender.system.layout=com....Log4jLayout

SamyaDaleh avatar Aug 16 '18 10:08 SamyaDaleh