in src/main/java/org/apache/log4j/xml/LogFileXMLReceiver.java [244:296]
public void start() {
Runnable runnable = () -> {
try {
URL url = new URL(fileURL);
host = url.getHost();
if (host != null && host.equals("")) {
host = FILE_KEY;
}
path = url.getPath();
} catch (MalformedURLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
try {
if (filterExpression != null) {
expressionRule = ExpressionRule.getRule(filterExpression);
}
} catch (Exception e) {
logger.warn("Invalid filter expression: " + filterExpression, e);
}
Class c;
try {
c = Class.forName(decoder);
Object o = c.newInstance();
if (o instanceof Decoder) {
decoderInstance = (Decoder) o;
}
} catch (ClassNotFoundException | IllegalAccessException | InstantiationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
reader = new InputStreamReader(new URL(getFileURL()).openStream());
process(reader);
} catch (FileNotFoundException fnfe) {
logger.info("file not available");
} catch (IOException ioe) {
logger.warn("unable to load file", ioe);
return;
}
};
if (useCurrentThread) {
runnable.run();
} else {
Thread thread = new Thread(runnable, "LogFileXMLReceiver-" + getName());
thread.start();
}
}