-2

I am trying to implement custom filter as mentioned in post Log4j2 custom filter .My lo4j2.xml is as follows

<?xml version="1.0" encoding="UTF-8"?>
<!-- Logger configuration when running outside of docker -->
<Configuration  status="trace" packages=“com.rest.server_common.logging">
    <Appenders>
        <Console name="Console" target="SYSTEM_OUT">
            <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss} %-5p [%t] %c{1}:%L - %m%n"/>
        </Console>
    </Appenders>
    <Loggers>

        <Root level="DEBUG">

                <com.rest.server_common.logging.MyCustomFilter level="DEBUG"/>

            <AppenderRef ref="Console"/>
        </Root>
    </Loggers>
</Configuration>

When I start my jetty server,I get the error

main ERROR Root contains an invalid element or attribute "com.rest.server_common.logging.MyCustomFilter"

What is the problem here? I have even tried moving filter line

<com.rest.server_common.logging.MyCustomFilter level="DEBUG"/>

after Configuration element but I still get the error

Chirayu Sharma
  • 75
  • 1
  • 11

1 Answers1

0

Just to close.The package was in different module so the filter was not getting recognised.

Chirayu Sharma
  • 75
  • 1
  • 11