Re: Problem spliting file by logging level.
"Piotr P. Karwasz" <[email protected]> Tue, 14 Jan 2025 22:46:53 +0100
| Newsgroups | gmane.comp.jakarta.log4j.user |
|---|---|
| Message-ID | <[email protected]> |
Hi Steven, On 14.01.2025 21:44, Nelligan, Steven M wrote: > <Loggers> > <Logger name="edu.uiuc.fs" level="DEBUG"> > <!--<level value="warn"/>--> > <AppenderRef ref="DEBUG_LOG" /> > </Logger> > <Root level="info"> > <appenderRef ref="CONSOLE" level="fatal" /> > <appenderRef ref="FILE" level="info" /> > </Root> > </Loggers> > </Configuration> > > (...) > > The file Account_Request.log is correct, but Account-request-debugging.log is wrong. > Should only contain "DEBUG" level logging. The `level` attributes in your configuration file act as a threshold filter. If you set `level="DEBUG"` you'll end up with all the log event of level DEBUG **or more severe** (INFO, WARN, ERROR, FATAL). To filter out only the log events with level **equal** to DEBUG, you can use a `LevelMatchFilter`[1]: <Logger name="edu.uiuc.fs" level="DEBUG"> <AppenderRef ref="DEBUG_LOG"> <LevelMatchFilter level="DEBUG"/> </AppenderRef> </Logger> Piotr [1] https://logging.apache.org/log4j/2.x/manual/filters.html#LevelMatchFilter