aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPiotr Jaszczyk <piotr.jaszczyk@nokia.com>2019-01-15 11:23:35 +0100
committerPiotr Jaszczyk <piotr.jaszczyk@nokia.com>2019-01-16 10:28:55 +0100
commit4c529a33439cc40bf192ea3f8dac57d189d60b9f (patch)
tree858e3ccfdd3da5164bf057e43308dd53281614f7
parent4b86cf306ca2dec0fb2a09258ea106259bf57b4d (diff)
Fix inconsistencies with logging guideline
Change-Id: I527ba0b3c313d946ae979b599e87bb4267a1793d Issue-ID: DCAEGEN2-1085 Signed-off-by: Piotr Jaszczyk <piotr.jaszczyk@nokia.com>
-rw-r--r--development/docker-compose.yml3
-rw-r--r--development/logs/.gitignore1
-rw-r--r--sources/hv-collector-main/src/main/resources/logback.xml45
3 files changed, 28 insertions, 21 deletions
diff --git a/development/docker-compose.yml b/development/docker-compose.yml
index 284199d0..83506fc3 100644
--- a/development/docker-compose.yml
+++ b/development/docker-compose.yml
@@ -71,7 +71,7 @@ services:
"--first-request-delay", "2",
"--log-level", "DEBUG"]
environment:
- JAVA_OPTS: "-Dio.netty.leakDetection.level=paranoid"
+ JAVA_OPTS: "-Dio.netty.leakDetection.level=paranoid -Dlogback.configurationFile=/etc/ONAP/dcae-hv-ves-collector/logback.xml"
healthcheck:
test: curl -f http://localhost:6060/health/ready || exit 1
interval: 10s
@@ -83,6 +83,7 @@ services:
- consul-config
volumes:
- ./ssl/:/etc/ves-hv/
+ - ./logs:/var/log/ONAP/dcae-hv-ves-collector
#
diff --git a/development/logs/.gitignore b/development/logs/.gitignore
new file mode 100644
index 00000000..f935021a
--- /dev/null
+++ b/development/logs/.gitignore
@@ -0,0 +1 @@
+!.gitignore
diff --git a/sources/hv-collector-main/src/main/resources/logback.xml b/sources/hv-collector-main/src/main/resources/logback.xml
index b54dc361..5ce34800 100644
--- a/sources/hv-collector-main/src/main/resources/logback.xml
+++ b/sources/hv-collector-main/src/main/resources/logback.xml
@@ -20,49 +20,54 @@
-->
<configuration>
<property name="COMPONENT_NAME"
- value="dcae-hv-ves-collector"/>
+ value="dcae-hv-ves-collector"/>
<property name="COMPONENT_SHORT_NAME"
- value="hv-ves"/>
+ value="hv-ves"/>
<property name="LOG_FILENAME" value="${COMPONENT_SHORT_NAME}"/>
<property name="LOG_PATH" value="/var/log/ONAP/${COMPONENT_NAME}"/>
<property name="ARCHIVE" value="${LOG_PATH}/archive"/>
- <property name="p_tim" value="%date{&quot;yyyy-MM-dd'T'HH:mm:ss.SSSXXX&quot;, UTC}"/>
- <property name="p_thr" value="%thread"/>
- <property name="p_lvl" value="%highlight(%-5level)"/>
- <property name="p_log" value="%50.50logger"/>
- <property name="p_mdc" value="%replace(%replace(%mdc){'\t', '\\\\t'}){'\n', '\\\\n'}"/>
+ <property name="p_log" value="%logger"/>
+ <property name="p_lor" value="%50.50logger"/>
+ <property name="p_tim" value="%date{yyyy-MM-dd'T'HH:mm:ss.SSSXXX,UTC}"/>
+ <property name="p_lvl" value="%level"/>
<property name="p_msg" value="%replace(%replace(%msg){'\t', '\\\\t'}){'\n','\\\\n'}"/>
+ <property name="p_mdc" value="%replace(%replace(%mdc){'\t', '\\\\t'}){'\n', '\\\\n'}"/>
<property name="p_exc" value="%replace(%replace(%rootException){'\t', '\\\\t'}){'\n','\\\\n'}"/>
<property name="p_mak" value="%replace(%replace(%marker){'\t', '\\\\t'}){'\n','\\\\n'}"/>
+ <property name="p_thr" value="%thread"/>
+
<property name="SIMPLE_LOG_PATTERN" value="
%nopexception
| ${p_tim}\t
-| ${p_log}\t
+| ${p_lor}\t
| ${p_lvl}\t
| %msg\t
| %rootException%n"/>
+
<property name="READABLE_LOG_PATTERN" value="
%nopexception
| ${p_tim}\t
-| ${p_log}\t
+| ${p_lor}\t
| ${p_lvl}\t
| %msg\t
| ${p_mak}\t
| %rootException\t
| ${p_mdc}\t
| ${p_thr}%n"/>
- <property name="ONAP_LOG_PATTERN" value="
-%nopexception
-| ${p_tim}\t
-| ${p_thr}\t
-| ${p_lvl}\t
-| ${p_log}\t
-| ${p_mdc}\t
-| ${p_msg}\t
-| ${p_exc}\t
-| ${p_mak}%n"/>
+
+ <property name="ONAP_LOG_PATTERN" value="%nopexception${p_log}|${p_tim}|${p_lvl}|${p_msg}|${p_mdc}|${p_exc}|${p_mak}|${p_thr}%n"/>
+
+ <property name="ONAP_LOG_PATTERN_FROM_WIKI" value="%nopexception%logger
+|%date{yyyy-MM-dd'T'HH:mm:ss.SSSXXX,UTC}
+|%level
+|%replace(%replace(%replace(%message){'\t','\\\\t'}){'\n','\\\\n'}){'|','\\\\|'}
+|%replace(%replace(%replace(%mdc){'\t','\\\\t'}){'\n','\\\\n'}){'|','\\\\|'}
+|%replace(%replace(%replace(%rootException){'\t','\\\\t'}){'\n','\\\\n'}){'|','\\\\|'}
+|%replace(%replace(%replace(%marker){'\t','\\\\t'}){'\n','\\\\n'}){'|','\\\\|'}
+|%thread
+|%n"/>
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
@@ -71,7 +76,7 @@
</appender>
<appender name="ROLLING-FILE"
- class="ch.qos.logback.core.rolling.RollingFileAppender">
+ class="ch.qos.logback.core.rolling.RollingFileAppender">
<encoder>
<pattern>${ONAP_LOG_PATTERN}</pattern>
</encoder>