aboutsummaryrefslogtreecommitdiffstats
path: root/prh-app-server/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'prh-app-server/src/main')
-rw-r--r--prh-app-server/src/main/resources/logback-spring.xml40
1 files changed, 12 insertions, 28 deletions
diff --git a/prh-app-server/src/main/resources/logback-spring.xml b/prh-app-server/src/main/resources/logback-spring.xml
index 0906836c..d6a37ade 100644
--- a/prh-app-server/src/main/resources/logback-spring.xml
+++ b/prh-app-server/src/main/resources/logback-spring.xml
@@ -1,12 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
- <property name="LOG_FILE"
- value="${LOG_FILE:-${LOG_PATH:-${LOG_TEMP:-${java.io.tmpdir:-/tmp}}}/spring.log}"/>
- <property name="FILE_LOG_PATTERN" value="${CONSOLE_LOG_PATTERN}"/>
- <Property name="outputFilename" value="prh-app-server_output"/>
- <Property name="log-path" value="/var/log/ONAP/prh/prh-app-server"/>
- <Property name="archive" value="/var/log/ONAP/prh/prh-app-server/archive"/>
+ <property name="outputFilename" value="prh-app-server_output"/>
+ <property name="logPath" value="/var/log/ONAP/prh/prh-app-server"/>
+ <property name="archivePath" value="${logPath}/archive"/>
<property name="maxFileSize" value="50MB"/>
<property name="maxHistory" value="30"/>
<property name="totalSizeCap" value="10GB"/>
@@ -19,8 +16,10 @@
|%replace(%replace(%marker){'\t','\\\\t'}){'\n','\\\\n'}
|%thread
|%n"/>
+ <variable name="logLevel" value="${LOG_LEVEL:-ERROR}"/>
+ <variable name="logLevelPrh" value="${PRH_LOG_LEVEL:-WARN}"/>
- <springProfile name="dev">
+ <springProfile name="prod">
<appender class="ch.qos.logback.core.ConsoleAppender" name="CONSOLE" target="SYSTEM_OUT">
<encoder>
<pattern>${defaultPattern}</pattern>
@@ -31,34 +30,19 @@
<encoder>
<pattern>${defaultPattern}</pattern>
</encoder>
- <file>${LOG_FILE}</file>
+ <File>${logPath}/${outputFilename}.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
- <FileNamePattern>${LOG_FILE}.%d{yyyy-MM-dd}.%i.log.zip</FileNamePattern>
+ <FileNamePattern>${archivePath}/${outputFilename}.%d{yyyy-MM-dd}.%i.log.zip</FileNamePattern>
<MaxFileSize>${maxFileSize}</MaxFileSize>
<MaxHistory>${maxHistory}</MaxHistory>
<TotalSizeCap>${totalSizeCap}</TotalSizeCap>
</rollingPolicy>
</appender>
- <root level="ERROR">
- <appender-ref ref="CONSOLE"/>
- <appender-ref ref="ROLLING-FILE"/>
- </root>
- </springProfile>
- <springProfile name="prod">
- <appender class="ch.qos.logback.core.rolling.RollingFileAppender" name="ROLLING-FILE">
- <encoder>
- <pattern>${defaultPattern}</pattern>
- </encoder>
- <File>${log-path}/${outputFilename}.log</File>
- <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
- <FileNamePattern>${archive}/${outputFilename}.%d{yyyy-MM-dd}.%i.log.zip</FileNamePattern>
- <MaxFileSize>${maxFileSize}</MaxFileSize>
- <MaxHistory>${maxHistory}</MaxHistory>
- <TotalSizeCap>${totalSizeCap}</TotalSizeCap>
- </rollingPolicy>
- </appender>
- <root level="ERROR">
+ <logger name="org.onap.dcaegen2.services.prh" level="${logLevelPrh}"/>
+
+ <root level="${logLevel}">
+ <appender-ref ref="CONSOLE"/>
<appender-ref ref="ROLLING-FILE"/>
</root>
</springProfile>