Skip to content

Commit

Permalink
refactor(apollo logging): Simplify the default log path to /opt/logs (#…
Browse files Browse the repository at this point in the history
…4833)

* add tech-support-qq-4.png

* Update README.md

* Enhance the user experience in the scenario of submitting duplicate keys

* Modify the key-value conflict exception prompt, adjust the code style

* refactor(apollo logging): Simplify the default log path to /opt/logs

* doc(CHANGES.md): Update CHANGES.md

* fix(apollo logging): Fix potential GC log path conflict issues

* chore(apollo logging): Adjusting the gc log file path style

---------

Co-authored-by: Jason Song <[email protected]>
  • Loading branch information
klboke and nobodyiam authored Apr 8, 2023
1 parent 3a6ff67 commit b30cbe5
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 28 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion apollo-adminservice/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ server:

logging:
file:
name: /opt/logs/100003172/apollo-adminservice.log
name: /opt/logs/apollo-adminservice.log

eureka:
instance:
Expand Down
10 changes: 5 additions & 5 deletions apollo-adminservice/src/main/scripts/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion apollo-configservice/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ server:

logging:
file:
name: /opt/logs/100003171/apollo-configservice.log
name: /opt/logs/apollo-configservice.log

eureka:
instance:
Expand Down
10 changes: 5 additions & 5 deletions apollo-configservice/src/main/scripts/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion apollo-portal/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ server:

logging:
file:
name: /opt/logs/100003173/apollo-portal.log
name: /opt/logs/apollo-portal.log

management:
health:
Expand Down
10 changes: 5 additions & 5 deletions apollo-portal/src/main/scripts/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b30cbe5

Please sign in to comment.