Skip to content

Commit

Permalink
add extra appender for warns (#668)
Browse files Browse the repository at this point in the history
  • Loading branch information
MajoBerger authored May 24, 2024
1 parent 2718a92 commit 573e3cc
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions dspace/config/log4j2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,32 @@
<policy type='TimeBasedTriggeringPolicy'>yyyy-MM-dd</policy>
</policies>
</Appender>

<!-- A4 is for Warns and errors -->
<Appender name='A4'
filePattern="${log.dir}/warn.log-%d{yyyy-MM-dd}"
type='RollingFile'
fileName='${log.dir}/warn.log'
>
<!-- NOTE: The %equals patterns are providing a default value of "unknown" if "correlationID" or
"requestID" are not currently set in the ThreadContext. -->
<Layout type='PatternLayout'
pattern='%d %-5p %equals{%X{correlationID}}{}{unknown} %equals{%X{requestID}}{}{unknown} %c @ %m%n'/>
<policies>
<policy type='TimeBasedTriggeringPolicy'>yyyy-MM-dd</policy>
</policies>
</Appender>
</Appenders>

<Loggers>


<!-- Most parts of DSpace -->
<Logger name='org.dspace'
level='${loglevel.dspace}'
additivity='false'>
<AppenderRef ref='A1'/>
<AppenderRef ref="A4" level="WARN"/>
</Logger>

<!-- The checksum checker -->
Expand Down Expand Up @@ -119,6 +136,7 @@
<!-- Anything not a part of DSpace -->
<Root level='${loglevel.other}'>
<AppenderRef ref='A1'/>
<AppenderRef ref="A4" level="WARN"/>
</Root>
</Loggers>
</Configuration>

0 comments on commit 573e3cc

Please sign in to comment.