Skip to content

Commit

Permalink
Merge pull request #1661 from SCADA-LTS/feature/#1659_change_log4j2
Browse files Browse the repository at this point in the history
Change Log4j2 to save logs to CATALINA_BASE instead of CATALINA_HOME.
  • Loading branch information
radek2s authored Apr 28, 2021
2 parents 4891e11 + 37c8318 commit 2323a7d
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions webapp-resources/log4j2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,49 @@
<!-- to make all loggers asynchronous https://logging.apache.org/log4j/2.x/manual/async.html -->
<Configuration>

<Properties>
<Property name="logdir">${sys:catalina.base}/logs</Property>
</Properties>

<Appenders>

<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="%-5p %d{ISO8601} (%C.%M:%L) - %m %n"/>
</Console>

<File name="LOG_FILE" filename="${env:CATALINA_HOME}/logs/mango.log">
<File name="LOG_FILE" filename="${logdir}/mango.log">
<PatternLayout pattern="%-5p %d{ISO8601} (%C.%M:%L) - %m %n"/>
</File>

<File name="LOG_FILE_HISTORY" filename="${env:CATALINA_HOME}/logs/history.log">
<File name="LOG_FILE_HISTORY" filename="${logdir}/history.log">
<PatternLayout pattern="%-5p %d{ISO8601} (%C.%M:%L) - %m %n"/>
</File>

<File name="LOG_FILE_MODBUS" filename="${env:CATALINA_HOME}/logs/modbus.log" append="false">
<File name="LOG_FILE_MODBUS" filename="${logdir}/modbus.log" append="false">
<PatternLayout pattern="%-5p %d{ISO8601} (%C.%M:%L) - %m %n"/>
</File>

<File name="LOG_FILE_SCRIPTS" filename="${env:CATALINA_HOME}/logs/scripts.log" append="false">
<File name="LOG_FILE_SCRIPTS" filename="${logdir}/scripts.log" append="false">
<PatternLayout pattern="%-5p %d{ISO8601} (%C.%M:%L) - %m %n"/>
</File>

<File name="LOG_FILE_API" filename="${env:CATALINA_HOME}/logs/api.log" append="false">
<File name="LOG_FILE_API" filename="${logdir}/api.log" append="false">
<PatternLayout pattern="%-5p %d{ISO8601} (%C.%M:%L) - %m %n"/>
</File>

<File name="LOG_FILE_VIEW_HIERARCHY" filename="${env:CATALINA_HOME}/logs/viehierarchyservicelogfile.log" append="false">
<File name="LOG_FILE_VIEW_HIERARCHY" filename="${logdir}/viehierarchyservicelogfile.log" append="false">
<PatternLayout pattern="%-5p %d{ISO8601} (%C.%M:%L) - %m %n"/>
</File>

<File name="LOG_FILE_FLYWAY" filename="${env:CATALINA_HOME}/logs/flyway.log" append="false">
<File name="LOG_FILE_FLYWAY" filename="${logdir}/flyway.log" append="false">
<PatternLayout pattern="%-5p %d{ISO8601} (%C.%M:%L) - %m %n"/>
</File>

<File name="LOG_FILE_SCADA-LTS_DAO" filename="${env:CATALINA_HOME}/logs/scadaLTSDAO.log" append="false">
<File name="LOG_FILE_SCADA-LTS_DAO" filename="${logdir}/scadaLTSDAO.log" append="false">
<PatternLayout pattern="%-5p %d{ISO8601} (%C.%M:%L) - %m %n"/>
</File>

<File name="LOG_FILE_DAO" filename="${env:CATALINA_HOME}/logs/dao.log" append="false">
<File name="LOG_FILE_DAO" filename="${logdir}/dao.log" append="false">
<PatternLayout pattern="%-5p %d{ISO8601} (%C.%M:%L) - %m %n"/>
</File>

Expand Down

0 comments on commit 2323a7d

Please sign in to comment.