The attachments can't be downloaded anymore, that's why I created a new example config using external entities:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration [
<!ENTITY commonappenders SYSTEM "appenders.xml">
]>
<configuration scan="true">
&commonappenders;
<root level="INFO">
<appender-ref ref="console" />
</root>
</configuration>
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<target>System.err</target>
<encoder>
<pattern>%d{ISO8601} %-5p [%-30.30c] - %m%n</pattern>
</encoder>
</appender>
Put those two files onto the classpath and start your program. You'll get the following exception:
SaX looks for appenders.xml in the wrong place, because it doesn't know the actual location of logback.xml and thus searches in default locations such as the current working directory, or user.dir (where of course appenders.xml cannot be found). This is always a problem if InputSource is set up only with an InputStream, but no systemId. If InputSource contains a proper systemId (along with the InputStream), SaX is able to resolve the location of appenders.xml and thus external entities will work properly.
|