Skip to content

Commit

Permalink
perf($JVM): enable JVM GC log
Browse files Browse the repository at this point in the history
[skip ci]
  • Loading branch information
johnnymillergh committed Sep 22, 2021
1 parent 33251b3 commit 0b8147b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ logs/
.DS_Store
HELP.md
nohup.out
*.log
*.gz

### STS ###
.apt_generated
Expand Down
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,22 @@ Here is the highlights of **Muscle and Fitness Server**:

12. [Knife4j](https://doc.xiaominfo.com/) API visualization. Enhanced Swagger API documentation.

13. Log compression. [ELK](https://www.elastic.co/what-is/elk-stack) log aggregation.
13. [Async log output](https://examples.javacodegeeks.com/enterprise-java/logback/logback-ayncappender-example/). Log file compressed by standard GNU zip ([gzip](https://en.wikipedia.org/wiki/Gzip)) compression algorithm. [ELK](https://www.elastic.co/what-is/elk-stack) log aggregation.

14. AOP based request log, configurable for turning on or off.
14. JVM log configuration for JVM garbage collection.

15. Customized method argument validation.
15. AOP based request log, configurable for turning on or off.

16. Customized method argument validation.

- [Date time range validator](https://github.com/johnnymillergh/muscle-and-fitness-server/blob/master/spring-cloud-starter/src/main/java/com/jmsoftware/maf/springcloudstarter/validation/validator/DateTimeRangeValidator.java)
- [Enum value validator](https://github.com/johnnymillergh/muscle-and-fitness-server/blob/master/spring-cloud-starter/src/main/java/com/jmsoftware/maf/springcloudstarter/validation/validator/EnumValueValidator.java)

16. Docker container log persistence. Size and time based rolling policy.
17. Docker container log persistence. Size and time based rolling policy.

17. [Startup and deployment statistics](https://github.com/johnnymillergh/muscle-and-fitness-server/blob/master/spring-cloud-starter/src/main/java/com/jmsoftware/maf/springcloudstarter/helper/SpringBootStartupHelper.java).
18. [Startup and deployment statistics](https://github.com/johnnymillergh/muscle-and-fitness-server/blob/master/spring-cloud-starter/src/main/java/com/jmsoftware/maf/springcloudstarter/helper/SpringBootStartupHelper.java).

18. Customized startup banner.
19. Customized startup banner.

## Usage

Expand Down
11 changes: 10 additions & 1 deletion docker/.env
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,16 @@ MUSCLE_MIS_CONTAINER_NAME=maf-muscle-mis
##################################################
# JIB contain's Java tool options #
##################################################
JAVA_TOOL_OPTIONS="-Xms128m -Xmx128m -Dspring.profiles.active=${SPRING_ENVIRONMENT} -Dspring.cloud.consul.host=${CONSUL_REGISTRY_CONTAINER_NAME}"
# JVM GC log reference https://programmer.group/analysis-and-use-of-the-log-related-parameters-of-openjdk-11-jvm.html
JAVA_TOOL_OPTIONS="
-Xms128m
-Xmx128m
-Dspring.profiles.active=${SPRING_ENVIRONMENT}
-Dspring.cloud.consul.host=${CONSUL_REGISTRY_CONTAINER_NAME}
-Xlog:gc*=info:stdout:time,level,tags
-Xlog:gc*=info:file=gc.%t.log:time,level,tags:filecount=10,filesize=20M
-XX:+PrintCommandLineFlags
"

##################################################
# Accounts, Passwords & Common Constants #
Expand Down

0 comments on commit 0b8147b

Please sign in to comment.