summaryrefslogtreecommitdiffstats
path: root/certServiceClient/src/main
diff options
context:
space:
mode:
authorkjaniak <kornel.janiak@nokia.com>2020-02-18 16:13:54 +0100
committerJoanna Jeremicz <joanna.jeremicz@nokia.com>2020-02-21 09:27:35 +0100
commit7e02d16d8a65c611f45523c51cb26535b1164064 (patch)
tree849050de09557cb31167c8b242f26d09da109949 /certServiceClient/src/main
parent18acead623826c43da43da6d0e55e81e1f2953a1 (diff)
Add of logging for certservice-client
Issue-ID: AAF-996 Signed-off-by: kjaniak <kornel.janiak@nokia.com> Change-Id: I8bed44937da32fff863df724adc023f546b5e12e
Diffstat (limited to 'certServiceClient/src/main')
-rw-r--r--certServiceClient/src/main/java/org/onap/aaf/certservice/client/CertServiceClient.java6
-rw-r--r--certServiceClient/src/main/java/org/onap/aaf/certservice/client/CertServiceClientApp.java1
-rw-r--r--certServiceClient/src/main/resources/log4j2.xml34
3 files changed, 40 insertions, 1 deletions
diff --git a/certServiceClient/src/main/java/org/onap/aaf/certservice/client/CertServiceClient.java b/certServiceClient/src/main/java/org/onap/aaf/certservice/client/CertServiceClient.java
index 4416d0ec..6e83a40e 100644
--- a/certServiceClient/src/main/java/org/onap/aaf/certservice/client/CertServiceClient.java
+++ b/certServiceClient/src/main/java/org/onap/aaf/certservice/client/CertServiceClient.java
@@ -19,12 +19,18 @@
package org.onap.aaf.certservice.client;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
public class CertServiceClient {
+ private static final Logger LOGGER = LoggerFactory.getLogger(CertServiceClient.class);
+
public void run(String[] args) {
exit(0);
}
protected void exit(int statusCode){
+ LOGGER.debug("Application exits with following exit code: " + statusCode);
System.exit(statusCode);
}
}
diff --git a/certServiceClient/src/main/java/org/onap/aaf/certservice/client/CertServiceClientApp.java b/certServiceClient/src/main/java/org/onap/aaf/certservice/client/CertServiceClientApp.java
index b0490e88..adbb02ad 100644
--- a/certServiceClient/src/main/java/org/onap/aaf/certservice/client/CertServiceClientApp.java
+++ b/certServiceClient/src/main/java/org/onap/aaf/certservice/client/CertServiceClientApp.java
@@ -25,5 +25,4 @@ public class CertServiceClientApp {
CertServiceClient certServiceClient = new CertServiceClient();
certServiceClient.run(args);
}
-
} \ No newline at end of file
diff --git a/certServiceClient/src/main/resources/log4j2.xml b/certServiceClient/src/main/resources/log4j2.xml
new file mode 100644
index 00000000..37eb078b
--- /dev/null
+++ b/certServiceClient/src/main/resources/log4j2.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<Configuration status="INFO">
+
+ <Appenders>
+ <Console name="CONSOLE" target="SYSTEM_OUT">
+ <PatternLayout
+ pattern="%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}} %highlight{${LOG_LEVEL_PATTERN:-%5p}}{FATAL=red blink, ERROR=red, WARN=yellow bold, INFO=green, DEBUG=green bold, TRACE=blue} %style{%pid}{magenta} [%15.15t] %style{%-40.40C{1.}}{cyan} : %m%n%throwable"/>
+ </Console>
+
+ <RollingFile fileName="var/log/onap/aaf/certservice-client/certservice-client.log" filePattern="logs/certservice-client-%d{yyyy-MM-dd}-%i.log" name="ROLLING_FILE">
+ <PatternLayout pattern="[%d{ISO8601}][%-5p][%-5c] %m%n"/>
+ <Policies>
+ <SizeBasedTriggeringPolicy size="64 MB"/>
+ </Policies>
+ <DefaultRolloverStrategy max="10"/>
+ </RollingFile>
+
+ </Appenders>
+
+ <Loggers>
+
+ <Logger name="reactor.netty" level="WARN"/>
+ <Logger name="reactor.netty.tcp.TcpServer" level="OFF"/>
+ <Logger name="io.netty" level="INFO"/>
+ <Logger name="io.netty.util" level="WARN"/>
+
+ <Root level="DEBUG">
+ <AppenderRef ref="CONSOLE"/>
+ <AppenderRef ref="ROLLING_FILE"/>
+ </Root>
+
+ </Loggers>
+</Configuration> \ No newline at end of file