This repository was archived by the owner on Jan 16, 2018. It is now read-only.
Description Hi,
For the log4j2.xml exemple file, you provide the following:
<?xml version =" 1.0" encoding =" UTF-8" ?>
<Configuration status =" OFF" packages =" org.graylog2.log4j2" >
<Appenders >
<GELF name =" gelfAppender" server =" graylog2.example.com" port =" 12201" hostName =" appserver01.example.com" >
<PatternLayout pattern =" %logger{36} - %msg%n" />
<Filters >
<Filter type =" MarkerFilter" marker =" FLOW" onMatch =" DENY" onMismatch =" NEUTRAL" />
<Filter type =" MarkerFilter" marker =" EXCEPTION" onMatch =" DENY" onMismatch =" ACCEPT" />
</Filters >
<!-- Additional fields -->
<KeyValuePair key =" foo" value =" bar" />
<KeyValuePair key =" jvm" value =" ${java:vm}" />
</GELF >
</Appenders >
<Loggers >
<Root level =" info" >
<AppenderRef ref =" gelfAppender" />
</Root >
</Loggers >
</Configuration >
But this will result with an error message with log4j2:2.6.2 on the Filters elements.
The way I got it to work is by using Filter type="" as specific class:
<?xml version =" 1.0" encoding =" UTF-8" ?>
<Configuration status =" OFF" packages =" org.graylog2.log4j2" >
<Appenders >
<GELF name =" gelfAppender" server =" graylog2.example.com" port =" 12201" hostName =" appserver01.example.com" >
<PatternLayout pattern =" %logger{36} - %msg%n" />
<Filters >
<MarkerFilter marker =" FLOW" onMatch =" DENY" onMismatch =" NEUTRAL" />
<MarkerFilter marker =" EXCEPTION" onMatch =" DENY" onMismatch =" ACCEPT" />
</Filters >
<!-- Additional fields -->
<KeyValuePair key =" foo" value =" bar" />
<KeyValuePair key =" jvm" value =" ${java:vm}" />
</GELF >
</Appenders >
<Loggers >
<Root level =" info" >
<AppenderRef ref =" gelfAppender" />
</Root >
</Loggers >
</Configuration > Reactions are currently unavailable
Hi,
For the log4j2.xml exemple file, you provide the following:
But this will result with an error message with
log4j2:2.6.2on theFilterselements.The way I got it to work is by using
Filter type=""as specific class: