diff --git a/CHANGES.md b/CHANGES.md index d6f1df67765..ae75e02dc43 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -22,6 +22,7 @@ Apollo 2.2.0 * [Fix the issue of the system permission management page retrieving non-existent users](https://github.com/apolloconfig/apollo/pull/4802) * [Add release history cleaning function](https://github.com/apolloconfig/apollo/pull/4813) * [[Multi-Database Support][pg] Make JdbcUserDetailsManager compat with postgre](https://github.com/apolloconfig/apollo/pull/4790) +* [refactor(apollo logging): Simplify the default log path to `/opt/logs`](https://github.com/apolloconfig/apollo/pull/4833) * [Add a configuration config-service.cache.key.ignore-case to control whether the cache key is case-sensitive](https://github.com/apolloconfig/apollo/pull/4820) ------------------ diff --git a/apollo-adminservice/src/main/resources/adminservice.properties b/apollo-adminservice/src/main/resources/adminservice.properties index ef2203e661c..9688532e022 100644 --- a/apollo-adminservice/src/main/resources/adminservice.properties +++ b/apollo-adminservice/src/main/resources/adminservice.properties @@ -16,5 +16,5 @@ #Used for apollo-assembly spring.application.name= apollo-adminservice server.port= 8090 -logging.file.name= /opt/logs/100003172/apollo-adminservice.log +logging.file.name= /opt/logs/apollo-adminservice.log spring.jmx.default-domain = apollo-adminservice diff --git a/apollo-adminservice/src/main/resources/apollo-adminservice.conf b/apollo-adminservice/src/main/resources/apollo-adminservice.conf index 9356960a1f7..563cd74ccf4 100644 --- a/apollo-adminservice/src/main/resources/apollo-adminservice.conf +++ b/apollo-adminservice/src/main/resources/apollo-adminservice.conf @@ -1,7 +1,7 @@ MODE=service PID_FOLDER=. # console appender log file folder -LOG_FOLDER=/opt/logs/100003172/ +LOG_FOLDER=/opt/logs/ # console appender file name LOG_FILENAME=console.log # write application logs only to file appender diff --git a/apollo-adminservice/src/main/resources/application.yml b/apollo-adminservice/src/main/resources/application.yml index 459e3b926d6..50d59311a8a 100644 --- a/apollo-adminservice/src/main/resources/application.yml +++ b/apollo-adminservice/src/main/resources/application.yml @@ -33,7 +33,7 @@ server: logging: file: - name: /opt/logs/100003172/apollo-adminservice.log + name: /opt/logs/apollo-adminservice.log eureka: instance: diff --git a/apollo-adminservice/src/main/scripts/startup.sh b/apollo-adminservice/src/main/scripts/startup.sh index 9106c265a3e..920ddc0d73b 100644 --- a/apollo-adminservice/src/main/scripts/startup.sh +++ b/apollo-adminservice/src/main/scripts/startup.sh @@ -16,7 +16,7 @@ # SERVICE_NAME=apollo-adminservice ## Adjust log dir if necessary -LOG_DIR=/opt/logs/100003172 +LOG_DIR=/opt/logs ## Adjust server port if necessary SERVER_PORT=${SERVER_PORT:=8090} @@ -97,14 +97,14 @@ if [[ "$javaexe" ]]; then version=$(echo "$version" | awk -F. '{printf("%03d%03d",$1,$2);}') # now version is of format 009003 (9.3.x) if [ $version -ge 011000 ]; then - JAVA_OPTS="$JAVA_OPTS -Xlog:gc*:$LOG_DIR/gc.log:time,level,tags -Xlog:safepoint -Xlog:gc+heap=trace" + JAVA_OPTS="$JAVA_OPTS -Xlog:gc*:$LOG_DIR/$SERVICE_NAME.gc.log:time,level,tags -Xlog:safepoint -Xlog:gc+heap=trace" elif [ $version -ge 010000 ]; then - JAVA_OPTS="$JAVA_OPTS -Xlog:gc*:$LOG_DIR/gc.log:time,level,tags -Xlog:safepoint -Xlog:gc+heap=trace" + JAVA_OPTS="$JAVA_OPTS -Xlog:gc*:$LOG_DIR/$SERVICE_NAME.gc.log:time,level,tags -Xlog:safepoint -Xlog:gc+heap=trace" elif [ $version -ge 009000 ]; then - JAVA_OPTS="$JAVA_OPTS -Xlog:gc*:$LOG_DIR/gc.log:time,level,tags -Xlog:safepoint -Xlog:gc+heap=trace" + JAVA_OPTS="$JAVA_OPTS -Xlog:gc*:$LOG_DIR/$SERVICE_NAME.gc.log:time,level,tags -Xlog:safepoint -Xlog:gc+heap=trace" else JAVA_OPTS="$JAVA_OPTS -XX:+UseParNewGC" - JAVA_OPTS="$JAVA_OPTS -Xloggc:$LOG_DIR/gc.log -XX:+PrintGCDetails" + JAVA_OPTS="$JAVA_OPTS -Xloggc:$LOG_DIR/$SERVICE_NAME.gc.log -XX:+PrintGCDetails" JAVA_OPTS="$JAVA_OPTS -XX:+UseConcMarkSweepGC -XX:+UseCMSCompactAtFullCollection -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=60 -XX:+CMSClassUnloadingEnabled -XX:+CMSParallelRemarkEnabled -XX:CMSFullGCsBeforeCompaction=9 -XX:+CMSClassUnloadingEnabled -XX:+PrintGCDateStamps -XX:+PrintGCApplicationConcurrentTime -XX:+PrintHeapAtGC -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=5M" fi fi diff --git a/apollo-configservice/src/main/resources/application.yml b/apollo-configservice/src/main/resources/application.yml index 1711f629d80..c7eb3fc5a15 100644 --- a/apollo-configservice/src/main/resources/application.yml +++ b/apollo-configservice/src/main/resources/application.yml @@ -33,7 +33,7 @@ server: logging: file: - name: /opt/logs/100003171/apollo-configservice.log + name: /opt/logs/apollo-configservice.log eureka: instance: diff --git a/apollo-configservice/src/main/scripts/startup.sh b/apollo-configservice/src/main/scripts/startup.sh index fe05ccce0b6..8ce950bcaaa 100644 --- a/apollo-configservice/src/main/scripts/startup.sh +++ b/apollo-configservice/src/main/scripts/startup.sh @@ -16,7 +16,7 @@ # SERVICE_NAME=apollo-configservice ## Adjust log dir if necessary -LOG_DIR=/opt/logs/100003171 +LOG_DIR=/opt/logs ## Adjust server port if necessary SERVER_PORT=${SERVER_PORT:=8080} @@ -97,14 +97,14 @@ if [[ "$javaexe" ]]; then version=$(echo "$version" | awk -F. '{printf("%03d%03d",$1,$2);}') # now version is of format 009003 (9.3.x) if [ $version -ge 011000 ]; then - JAVA_OPTS="$JAVA_OPTS -Xlog:gc*:$LOG_DIR/gc.log:time,level,tags -Xlog:safepoint -Xlog:gc+heap=trace" + JAVA_OPTS="$JAVA_OPTS -Xlog:gc*:$LOG_DIR/$SERVICE_NAME.gc.log:time,level,tags -Xlog:safepoint -Xlog:gc+heap=trace" elif [ $version -ge 010000 ]; then - JAVA_OPTS="$JAVA_OPTS -Xlog:gc*:$LOG_DIR/gc.log:time,level,tags -Xlog:safepoint -Xlog:gc+heap=trace" + JAVA_OPTS="$JAVA_OPTS -Xlog:gc*:$LOG_DIR/$SERVICE_NAME.gc.log:time,level,tags -Xlog:safepoint -Xlog:gc+heap=trace" elif [ $version -ge 009000 ]; then - JAVA_OPTS="$JAVA_OPTS -Xlog:gc*:$LOG_DIR/gc.log:time,level,tags -Xlog:safepoint -Xlog:gc+heap=trace" + JAVA_OPTS="$JAVA_OPTS -Xlog:gc*:$LOG_DIR/$SERVICE_NAME.gc.log:time,level,tags -Xlog:safepoint -Xlog:gc+heap=trace" else JAVA_OPTS="$JAVA_OPTS -XX:+UseParNewGC" - JAVA_OPTS="$JAVA_OPTS -Xloggc:$LOG_DIR/gc.log -XX:+PrintGCDetails" + JAVA_OPTS="$JAVA_OPTS -Xloggc:$LOG_DIR/$SERVICE_NAME.gc.log -XX:+PrintGCDetails" JAVA_OPTS="$JAVA_OPTS -XX:+UseConcMarkSweepGC -XX:+UseCMSCompactAtFullCollection -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=60 -XX:+CMSClassUnloadingEnabled -XX:+CMSParallelRemarkEnabled -XX:CMSFullGCsBeforeCompaction=9 -XX:+CMSClassUnloadingEnabled -XX:+PrintGCDateStamps -XX:+PrintGCApplicationConcurrentTime -XX:+PrintHeapAtGC -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=5M" fi fi diff --git a/apollo-portal/src/main/resources/application.yml b/apollo-portal/src/main/resources/application.yml index 600afc19206..475980fb37c 100644 --- a/apollo-portal/src/main/resources/application.yml +++ b/apollo-portal/src/main/resources/application.yml @@ -46,7 +46,7 @@ server: logging: file: - name: /opt/logs/100003173/apollo-portal.log + name: /opt/logs/apollo-portal.log management: health: diff --git a/apollo-portal/src/main/scripts/startup.sh b/apollo-portal/src/main/scripts/startup.sh index 6e1c35d723e..a4d672d8df4 100755 --- a/apollo-portal/src/main/scripts/startup.sh +++ b/apollo-portal/src/main/scripts/startup.sh @@ -16,7 +16,7 @@ # SERVICE_NAME=apollo-portal ## Adjust log dir if necessary -LOG_DIR=/opt/logs/100003173 +LOG_DIR=/opt/logs ## Adjust server port if necessary SERVER_PORT=${SERVER_PORT:=8070} @@ -97,14 +97,14 @@ if [[ "$javaexe" ]]; then version=$(echo "$version" | awk -F. '{printf("%03d%03d",$1,$2);}') # now version is of format 009003 (9.3.x) if [ $version -ge 011000 ]; then - JAVA_OPTS="$JAVA_OPTS -Xlog:gc*:$LOG_DIR/gc.log:time,level,tags -Xlog:safepoint -Xlog:gc+heap=trace" + JAVA_OPTS="$JAVA_OPTS -Xlog:gc*:$LOG_DIR/$SERVICE_NAME.gc.log:time,level,tags -Xlog:safepoint -Xlog:gc+heap=trace" elif [ $version -ge 010000 ]; then - JAVA_OPTS="$JAVA_OPTS -Xlog:gc*:$LOG_DIR/gc.log:time,level,tags -Xlog:safepoint -Xlog:gc+heap=trace" + JAVA_OPTS="$JAVA_OPTS -Xlog:gc*:$LOG_DIR/$SERVICE_NAME.gc.log:time,level,tags -Xlog:safepoint -Xlog:gc+heap=trace" elif [ $version -ge 009000 ]; then - JAVA_OPTS="$JAVA_OPTS -Xlog:gc*:$LOG_DIR/gc.log:time,level,tags -Xlog:safepoint -Xlog:gc+heap=trace" + JAVA_OPTS="$JAVA_OPTS -Xlog:gc*:$LOG_DIR/$SERVICE_NAME.gc.log:time,level,tags -Xlog:safepoint -Xlog:gc+heap=trace" else JAVA_OPTS="$JAVA_OPTS -XX:+UseParNewGC" - JAVA_OPTS="$JAVA_OPTS -Xloggc:$LOG_DIR/gc.log -XX:+PrintGCDetails" + JAVA_OPTS="$JAVA_OPTS -Xloggc:$LOG_DIR/$SERVICE_NAME.gc.log -XX:+PrintGCDetails" JAVA_OPTS="$JAVA_OPTS -XX:+UseConcMarkSweepGC -XX:+UseCMSCompactAtFullCollection -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=60 -XX:+CMSClassUnloadingEnabled -XX:+CMSParallelRemarkEnabled -XX:CMSFullGCsBeforeCompaction=9 -XX:+CMSClassUnloadingEnabled -XX:+PrintGCDateStamps -XX:+PrintGCApplicationConcurrentTime -XX:+PrintHeapAtGC -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=5M" fi fi diff --git a/docs/en/development/portal-how-to-implement-user-login-function.md b/docs/en/development/portal-how-to-implement-user-login-function.md index 89d51895b15..80686150e96 100644 --- a/docs/en/development/portal-how-to-implement-user-login-function.md +++ b/docs/en/development/portal-how-to-implement-user-login-function.md @@ -119,7 +119,7 @@ Modify `scripts/startup.sh` to specify `spring.profiles.active` as `github,ldap` ```bash SERVICE_NAME=apollo-portal ## Adjust log dir if necessary -LOG_DIR=/opt/logs/100003173 +LOG_DIR=/opt/logs ## Adjust server port if necessary SERVER_PORT=8070 @@ -159,7 +159,7 @@ Modify ``scripts/startup.sh`` to specify ``spring.profiles.active`` as ``github, ```bash SERVICE_NAME=apollo-portal ## Adjust log dir if necessary -LOG_DIR=/opt/logs/100003173 +LOG_DIR=/opt/logs ## Adjust server port if necessary SERVER_PORT=8070 @@ -225,7 +225,7 @@ Modify ``scripts/startup.sh`` to specify ``spring.profiles.active`` as ``github, ```bash SERVICE_NAME=apollo-portal ## Adjust log dir if necessary -LOG_DIR=/opt/logs/100003173 +LOG_DIR=/opt/logs ## Adjust server port if necessary SERVER_PORT=8070 @@ -401,7 +401,7 @@ Modify ``scripts/startup.sh`` to specify ``spring.profiles.active`` as ``github, ```bash SERVICE_NAME=apollo-portal ## Adjust log dir if necessary -LOG_DIR=/opt/logs/100003173 +LOG_DIR=/opt/logs ## Adjust server port if necessary SERVER_PORT=8070 diff --git a/docs/zh/development/portal-how-to-implement-user-login-function.md b/docs/zh/development/portal-how-to-implement-user-login-function.md index dedbb29751f..cb406e616e3 100644 --- a/docs/zh/development/portal-how-to-implement-user-login-function.md +++ b/docs/zh/development/portal-how-to-implement-user-login-function.md @@ -115,7 +115,7 @@ ldap: ```bash SERVICE_NAME=apollo-portal ## Adjust log dir if necessary -LOG_DIR=/opt/logs/100003173 +LOG_DIR=/opt/logs ## Adjust server port if necessary SERVER_PORT=8070 @@ -155,7 +155,7 @@ ldap: ```bash SERVICE_NAME=apollo-portal ## Adjust log dir if necessary -LOG_DIR=/opt/logs/100003173 +LOG_DIR=/opt/logs ## Adjust server port if necessary SERVER_PORT=8070 @@ -221,7 +221,7 @@ ldap: ```bash SERVICE_NAME=apollo-portal ## Adjust log dir if necessary -LOG_DIR=/opt/logs/100003173 +LOG_DIR=/opt/logs ## Adjust server port if necessary SERVER_PORT=8070 @@ -396,7 +396,7 @@ spring: ```bash SERVICE_NAME=apollo-portal ## Adjust log dir if necessary -LOG_DIR=/opt/logs/100003173 +LOG_DIR=/opt/logs ## Adjust server port if necessary SERVER_PORT=8070