diff options
author | Piotr Bocheński <piotr.bochenski@nokia.com> | 2019-01-25 15:23:01 +0100 |
---|---|---|
committer | Piotr Bocheński <piotr.bochenski@nokia.com> | 2019-01-25 15:23:01 +0100 |
commit | e0e5f2a54c18d790ec8a9800233599cb7fe93b3d (patch) | |
tree | e8d5d92b519ef1c57afff474c2b9c560d16746ec /prh-app-server | |
parent | 05fd72a273f62828f1e207e68c46b9df80108a41 (diff) |
Improve logging facade
Change-Id: I6b489ae343b6e3d05839b34839205b5260f9378c
Issue-ID: DCAEGEN2-1030
Signed-off-by: Piotr Bocheński <piotr.bochenski@nokia.com>
Diffstat (limited to 'prh-app-server')
-rw-r--r-- | prh-app-server/pom.xml | 2 | ||||
-rw-r--r-- | prh-app-server/src/main/resources/logback-spring.xml | 40 |
2 files changed, 13 insertions, 29 deletions
diff --git a/prh-app-server/pom.xml b/prh-app-server/pom.xml index 405a97ff..f488ecbd 100644 --- a/prh-app-server/pom.xml +++ b/prh-app-server/pom.xml @@ -96,7 +96,7 @@ <expose>8100</expose> <expose>8433</expose> </exposes> - <cmd>java -cp ${docker.artifact.dir}/${dependency.dir.name}/*:${docker.artifact.dir}/${project.build.finalName}.jar ${prh.main.class}</cmd> + <entryPoint>java -cp ${docker.artifact.dir}/${dependency.dir.name}/*:${docker.artifact.dir}/${project.build.finalName}.jar ${prh.main.class}</entryPoint> <resources> <resource> <directory>${dependency.dir.location}</directory> 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> |