I am trying to use Flume Appender Properties of log4j2 .But the following errors are obtained when run the program .
2016-01-20 16:36:42,436 main ERROR Appenders contains an invalid element or attribute "Flume"
2016-01-20 16:36:42,436 main ERROR Appenders contains an invalid element or attribute "Flume"
2016-01-20 16:36:42,446 main ERROR Unable to locate appender "eventLogger" for logger config "root"
2016-01-20 16:36:42,446 main ERROR Unable to locate appender "eventLogger" for logger config "root"
The log4j.xml file is:
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN">
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n" />
</Console>
<Flume name="eventLogger" compress="false" type="Avro">
<Agent host="192.168.8.50" port="41414"/>
</Flume>
</Appenders>
<Loggers>
<Root level="info">
<AppenderRef ref="Console" />
<AppenderRef ref="eventLogger" />
</Root>
</Loggers>
</Configuration>
And in .java code
LoggerContext context = (org.apache.logging.log4j.core.LoggerContext) LogManager.getContext(false);
File file = new File("src/log4j2.xml");
context.setConfigLocation(file.toURI());
How I can figure out the problem .May be log4j2 doesn't work properly .