summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--certService/pom.xml12
-rw-r--r--certService/src/main/resources/log4j2.xml58
2 files changed, 70 insertions, 0 deletions
diff --git a/certService/pom.xml b/certService/pom.xml
index 21d212f1..affdda3b 100644
--- a/certService/pom.xml
+++ b/certService/pom.xml
@@ -37,6 +37,7 @@
<maven-javadoc-plugin.version>3.0.1</maven-javadoc-plugin.version>
<maven-surefire-plugin.version>3.0.0-M1</maven-surefire-plugin.version>
<spring-boot-starter-actuator.version>2.2.4.RELEASE</spring-boot-starter-actuator.version>
+ <spring-boot-starter-log4j2.version>2.1.5.RELEASE</spring-boot-starter-log4j2.version>
</properties>
<dependencyManagement>
@@ -57,6 +58,17 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>${spring-boot-starter.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-logging</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-log4j2</artifactId>
+ <version>${spring-boot-starter-log4j2.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
diff --git a/certService/src/main/resources/log4j2.xml b/certService/src/main/resources/log4j2.xml
new file mode 100644
index 00000000..0c4d613f
--- /dev/null
+++ b/certService/src/main/resources/log4j2.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<Configuration status="INFO">
+
+ <Appenders>
+
+ <Console name="CONSOLE" target="SYSTEM_OUT">
+ <LevelRangeFilter maxLevel="INFO" minLevel="ERROR"/>
+ <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{${sys:PID}}{magenta} [%15.15t] %style{%-40.40C{1.}}{cyan} : %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}"/>
+ </Console>
+
+ <RollingFile fileName="var/log/onap/aaf/certservice/error.log" filePattern="logs/error-%d{yyyy-MM-dd}-%i.log" name="ERROR_LOG">
+ <LevelRangeFilter maxLevel="ERROR" minLevel="ERROR"/>
+ <PatternLayout pattern="[%d{ISO8601}][%-5p][%-5c] %m%n"/>
+ <Policies>
+ <SizeBasedTriggeringPolicy size="64 MB"/>
+ </Policies>
+ <DefaultRolloverStrategy max="10"/>
+ </RollingFile>
+
+ <RollingFile fileName="var/log/onap/aaf/certservice/trace.log" filePattern="logs/trace-%d{yyyy-MM-dd}-%i.log" name="TRACE_LOG">
+ <LevelRangeFilter maxLevel="TRACE" minLevel="ERROR"/>
+ <PatternLayout pattern="[%d{ISO8601}][%-5p][%-5c] %m%n"/>
+ <Policies>
+ <SizeBasedTriggeringPolicy size="64 MB"/>
+ </Policies>
+ <DefaultRolloverStrategy max="10"/>
+ </RollingFile>
+
+ <RollingFile fileName="var/log/onap/aaf/certservice/audit.log" filePattern="logs/audit-%d{yyyy-MM-dd}-%i.log" name="AUDIT_LOG">
+ <LevelRangeFilter maxLevel="INFO" minLevel="INFO"/>
+ <PatternLayout pattern="[%d{ISO8601}][%-5p][%-5c] %m%n"/>
+ <Policies>
+ <SizeBasedTriggeringPolicy size="32 MB"/>
+ </Policies>
+ <DefaultRolloverStrategy max="10"/>
+ </RollingFile>
+
+ </Appenders>
+
+ <Loggers>
+
+ <Logger name="org.springframework" level="ERROR"/>
+ <Logger name="org.hibernate" level="ERROR"/>
+ <Logger name="org.apache" level="ERROR"/>
+ <Logger name="io.micrometer" level="ERROR"/>
+
+ <Root additivity="false" level="TRACE">
+ <AppenderRef ref="CONSOLE"/>
+ <AppenderRef ref="ERROR_LOG"/>
+ <AppenderRef ref="TRACE_LOG"/>
+ <AppenderRef ref="AUDIT_LOG"/>
+ </Root>
+
+ </Loggers>
+
+</Configuration> \ No newline at end of file