diff options
author | YiLi <li.yi101@zte.com.cn> | 2018-03-16 14:04:25 +0800 |
---|---|---|
committer | YiLi <li.yi101@zte.com.cn> | 2018-03-16 14:27:40 +0800 |
commit | 2504d624b6c65ee919db506f870ee17b31e51f90 (patch) | |
tree | e3f64dcc061e118ad54afc8e78e7e82a579983c4 | |
parent | 8754c29599ef6e59be3de0536514367f2256142f (diff) |
Add init log filter and modify engine-d.yml
Change-Id: I89da89c60b34f02ae21819b80b175395e2d9e2c9
Issue-ID: HOLMES-112
Signed-off-by: YiLi <li.yi101@zte.com.cn>
-rw-r--r-- | engine-d-standalone/src/main/assembly/conf/engine-d.yml | 22 | ||||
-rw-r--r-- | engine-d/src/main/java/org/onap/holmes/engine/EngineDActiveApp.java | 5 |
2 files changed, 19 insertions, 8 deletions
diff --git a/engine-d-standalone/src/main/assembly/conf/engine-d.yml b/engine-d-standalone/src/main/assembly/conf/engine-d.yml index c5a750a..7ed3c8e 100644 --- a/engine-d-standalone/src/main/assembly/conf/engine-d.yml +++ b/engine-d-standalone/src/main/assembly/conf/engine-d.yml @@ -31,24 +31,30 @@ server: logging:
# The default level of all loggers. Can be OFF, ERROR, WARN, INFO, DEBUG, TRACE, or ALL.
- level: INFO
+ level: ALL
# Logger-specific levels.
loggers:
# Sets the level for 'com.example.app' to DEBUG.
- com.example: DEBUG
+ org.onap.holmes.engine: ALL
appenders:
- type: console
- threshold: INFO
+ threshold: ALL
timeZone: UTC
- logFormat: "%d{yyyy-MM-dd HH:mm:ss SSS} %-5p [%c][%t] - %m%n"
+ logFormat: "%nopexception%logger\n|%date{yyyy-MM-dd'T'HH:mm:ss.SSSXXX,UTC}\n|%level\n|%message\n|[%mdc]\n|%rootException\n|%marker\n|%thread\n|%n \r\n"
- type: file
- threshold: INFO
- logFormat: "%d{yyyy-MM-dd HH:mm:ss SSS} %-5p [%c][%t] - %m%n"
- currentLogFilename: ../logs/holmes-engine-d.log
- archivedLogFilenamePattern: ../logs/zip/holmes-engine-d-%d{yyyy-MM-dd}.log.gz
+ threshold: ERROR
+ logFormat: "%nopexception%logger\n|%date{yyyy-MM-dd'T'HH:mm:ss.SSSXXX,UTC}\n|%level\n|%message\n|%X{InvocationID}\n|%rootException\n|%marker\n|%thread\n|%n \r\n"
+ currentLogFilename: /var/log/ONAP/holmes/engine-d-error.log
+ archivedLogFilenamePattern: /var/log/ONAP/holmes/zip/engine-d-error-%d{yyyy-MM-dd}.log.gz
+ archivedFileCount: 7
+ - type: file
+ threshold: DEBUG
+ logFormat: "%nopexception%logger\n|%date{yyyy-MM-dd'T'HH:mm:ss.SSSXXX,UTC}\n|%level\n|%message\n|%X{InvocationID}\n|%rootException\n|%marker\n|%thread\n|%n \r\n"
+ currentLogFilename: /var/log/ONAP/holmes/engine-d-debug.log
+ archivedLogFilenamePattern: /var/log/ONAP/holmes/zip/engine-d-debug-%d{yyyy-MM-dd}.log.gz
archivedFileCount: 7
diff --git a/engine-d/src/main/java/org/onap/holmes/engine/EngineDActiveApp.java b/engine-d/src/main/java/org/onap/holmes/engine/EngineDActiveApp.java index 0e7acac..a0f46ce 100644 --- a/engine-d/src/main/java/org/onap/holmes/engine/EngineDActiveApp.java +++ b/engine-d/src/main/java/org/onap/holmes/engine/EngineDActiveApp.java @@ -16,16 +16,19 @@ package org.onap.holmes.engine; import io.dropwizard.setup.Environment; +import java.util.EnumSet; import java.util.HashSet; import java.util.Set; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; +import javax.servlet.DispatcherType; import lombok.extern.slf4j.Slf4j; import org.onap.holmes.common.config.MicroServiceConfig; import org.onap.holmes.common.dropwizard.ioc.bundle.IOCApplication; import org.onap.holmes.common.exception.CorrelationException; import org.onap.holmes.common.utils.MSBRegisterUtil; +import org.onap.holmes.common.utils.transactionid.TransactionIdFilter; import org.onap.holmes.engine.dcae.DcaeConfigurationPolling; import org.onap.holmes.engine.resources.EngineResources; import org.onap.msb.sdk.discovery.entity.MicroServiceInfo; @@ -52,6 +55,8 @@ public class EngineDActiveApp extends IOCApplication<EngineDAppConfig> { service.scheduleAtFixedRate( new DcaeConfigurationPolling(MicroServiceConfig.getEnv(MicroServiceConfig.HOSTNAME)), 0, DcaeConfigurationPolling.POLLING_PERIOD, TimeUnit.MILLISECONDS); + environment.servlets().addFilter("logFilter",new TransactionIdFilter()).addMappingForUrlPatterns(EnumSet + .allOf(DispatcherType.class),true,"/*"); } private MicroServiceInfo createMicroServiceInfo() { |