java - Log4j2 use XInclude from within an executable jar -
i have 2 webapps , executable jar (3 in total) using similar log4j2 set up.
all 3 apps following
<configuration status="off" xmlns:xi="http://www.w3.org/2001/xinclude"> <properties> <property name="logfile-name">logname.log</property> <property name="logfile-folder">/home/${env:puid}/utm/logs</property> <property name="console-pattern">%d [%-6p] %c{1}.%m(%l) - %msg %n</property> <property name="logfile-pattern">%d [%-6p] %c{1}.%m - %msg %n</property> <property name="max-log-size">100 mb</property> <property name="max-log-keep">12</property> <property name="rolling-interval">1</property> </properties> <xi:include href="/opt/app/jtm/conf/jtm-log4j-appenders.xml" /> <xi:include href="/opt/app/jtm/conf/jtm-log4j-loggers.xml" /> </configuration>
properties passed appenders.xml , loggers.xml projects. works fine webapps.
the executable jarfile reports error
[warning] log4j2.xml:23:66: include operation failed, reverting fallback. resource error reading file xml (href='/opt/app/jtm/conf/jtm-log4j-appenders.xml'). reason: no !/ in spec [fatal error] log4j2.xml:23:66: include href '/opt/app/jtm/conf/jtm-log4j-appenders.xml'failed, , no fallback element found. error statuslogger error parsing jar:file:/c:/workspaces/jtm/jtm-irtransferfile/dist/irtransferfile.jar!/log4j2.xml org.xml.sax.saxparseexception; systemid: jar:file:/c:/workspaces/jtm/jtm-irtransferfile/dist/irtransferfile.jar!/log4j2.xml; linenumber: 23; columnnumber: 66; include href '/opt/app/jtm/conf/jtm-log4j-appenders.xml'failed, , no fallback element found.
i've looked in few places on web , there nothing outright answer this. feeling might due executable jar reading file system i'm struggling little.
Comments
Post a Comment