Question

I have a log4j2.xml that performs basic webservice logging. As I want to include the webservice project as dependency within another project, I'd like to inherit the logging configuration.

<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
    <Appenders>
        <RollingFile name="rolling">
            ...
        </RollingFile>
    </Appenders>

    <Loggers>
        <Root level="all">
            <AppenderRef ref="rolling />
        </Root>
    </Loggers>
</Configuration>

As I did not find a way so far to inherit this config. Is it impossible?

Was it helpful?

Solution

I don't know exactly what you mean by inheriting a logging configuration, but log4j2 supports XInclude for XML configurations. I hope that is useful.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top