diff --git a/collector/pom.xml b/collector/pom.xml index 25062f5a6fe4..77ee9191a8e2 100644 --- a/collector/pom.xml +++ b/collector/pom.xml @@ -175,7 +175,10 @@ org.apache.logging.log4j log4j-core - + + org.apache.logging.log4j + log4j-spring-boot + org.springframework diff --git a/collector/src/main/resources/profiles/local/log4j2.xml b/collector/src/main/resources/log4j2-spring.xml similarity index 56% rename from collector/src/main/resources/profiles/local/log4j2.xml rename to collector/src/main/resources/log4j2-spring.xml index 33099797f4e8..2ea01211e2e5 100644 --- a/collector/src/main/resources/profiles/local/log4j2.xml +++ b/collector/src/main/resources/log4j2-spring.xml @@ -5,16 +5,53 @@ ${sys:logging.file.path:-${default_logging_dir}} %d{yyyy-MM-dd} - 1GB - - %d{MM-dd HH:mm:ss.sss} [%15.15t] %clr{%-5level} %clr{%-40.40logger{1.}}{cyan}:%3L -- %msg{nolookups}%n - %d{MM-dd HH:mm:ss.sss} [%15.15t] %-5level %-40.40logger{1.}:%3L -- %msg{nolookups}%n + - - - + + @@ -29,8 +66,8 @@ - - + + @@ -56,7 +93,7 @@ - + @@ -90,11 +127,11 @@ - + - + @@ -107,7 +144,7 @@ - + diff --git a/collector/src/main/resources/profiles/release/log4j2.xml b/collector/src/main/resources/profiles/release/log4j2.xml deleted file mode 100644 index 7889651aed6d..000000000000 --- a/collector/src/main/resources/profiles/release/log4j2.xml +++ /dev/null @@ -1,103 +0,0 @@ - - - - logs - ${sys:logging.file.path:-${default_logging_dir}} - - %d{yyyy-MM-dd} - 100GB - - %d{MM-dd HH:mm:ss.sss} [%15.15t] %clr{%-5level} %clr{%-40.40logger{1.}}{cyan} : %msg{nolookups}%n - %d{MM-dd HH:mm:ss.sss} [%15.15t] %-5level %-40.40logger{1.} : %msg{nolookups}%n - - - - - - - - - - ${file_message_pattern} - - - - - - - - - - - - - - - - - - - - ${file_message_pattern} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/commons-server/src/main/java/com/navercorp/pinpoint/common/server/profile/PinpointProfileEnvironment.java b/commons-server/src/main/java/com/navercorp/pinpoint/common/server/profile/PinpointProfileEnvironment.java index 8e7446a25338..9021584e921c 100644 --- a/commons-server/src/main/java/com/navercorp/pinpoint/common/server/profile/PinpointProfileEnvironment.java +++ b/commons-server/src/main/java/com/navercorp/pinpoint/common/server/profile/PinpointProfileEnvironment.java @@ -37,7 +37,7 @@ public void processEnvironment(ConfigurableEnvironment environment) { logger.info(String.format("%s=%s", PINPOINT_ACTIVE_PROFILE, pinpointProfile)); Pair profile = ImmutablePair.of(PINPOINT_ACTIVE_PROFILE, pinpointProfile); - Pair log4j2Path = log4j2Path(pinpointProfile); + Pair log4j2Path = log4j2Path(); Properties properties = merge(profile, log4j2Path); for (Map.Entry entry : properties.entrySet()) { @@ -77,8 +77,8 @@ private String getDefaultProfile(String[] activeProfiles) { return activeProfiles[0]; } - private Pair log4j2Path(String pinpointActiveProfile) { - String logConfig = String.format("classpath:profiles/%s/log4j2.xml", pinpointActiveProfile); + private Pair log4j2Path() { + String logConfig = "classpath:log4j2-spring.xml"; return ImmutablePair.of("logging.config", logConfig); } diff --git a/pom.xml b/pom.xml index ddd0bbf6955a..340f1c1f83a1 100644 --- a/pom.xml +++ b/pom.xml @@ -203,7 +203,7 @@ 3.4.6 4.8.1 - 1.12.18 + 1.12.18 1.17.6 @@ -815,6 +815,13 @@ + + org.apache.logging.log4j + log4j-spring-boot + ${log4j2.version} + runtime + + org.slf4j slf4j-api diff --git a/web/pom.xml b/web/pom.xml index 98cc7ecaf2af..59f8e5ec65ac 100644 --- a/web/pom.xml +++ b/web/pom.xml @@ -286,6 +286,10 @@ org.apache.logging.log4j log4j-core + + org.apache.logging.log4j + log4j-spring-boot + commons-codec diff --git a/web/src/main/resources/log4j2-spring.xml b/web/src/main/resources/log4j2-spring.xml new file mode 100644 index 000000000000..91dcc0379a8f --- /dev/null +++ b/web/src/main/resources/log4j2-spring.xml @@ -0,0 +1,144 @@ + + + + logs + ${sys:logging.file.path:-${default_logging_dir}} + + %d{yyyy-MM-dd} + + + + + + + + + ${file_message_pattern} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/web/src/main/resources/profiles/local/log4j2.xml b/web/src/main/resources/profiles/local/log4j2.xml deleted file mode 100644 index 7ade7a678643..000000000000 --- a/web/src/main/resources/profiles/local/log4j2.xml +++ /dev/null @@ -1,108 +0,0 @@ - - - - logs - ${sys:logging.file.path:-${default_logging_dir}} - - %d{yyyy-MM-dd} - 1GB - - %d{MM-dd HH:mm:ss.sss} [%15.15t] %clr{%-5level} %clr{%-40.40logger{1.}}{cyan}:%3L -- %msg{nolookups}%n - %d{MM-dd HH:mm:ss.sss} [%15.15t] %-5level %-40.40logger{1.}:%3L -- %msg{nolookups}%n - - - - - - - - - - ${file_message_pattern} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/web/src/main/resources/profiles/release/log4j2.xml b/web/src/main/resources/profiles/release/log4j2.xml deleted file mode 100644 index 06d41685eb56..000000000000 --- a/web/src/main/resources/profiles/release/log4j2.xml +++ /dev/null @@ -1,103 +0,0 @@ - - - - logs - ${sys:logging.file.path:-${default_logging_dir}} - - %d{yyyy-MM-dd} - 100GB - - %d{MM-dd HH:mm:ss.sss} [%15.15t] %clr{%-5level} %clr{%-40.40logger{1.}}{cyan} -- %msg{nolookups}%n - %d{MM-dd HH:mm:ss.sss} [%15.15t] %-5level %-40.40logger{1.} -- %msg{nolookups}%n - - - - - - - - - - ${file_message_pattern} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file