Skip to content

Commit

Permalink
[ISSUE apache#71] Reduce log file size and Streamline debug output (a…
Browse files Browse the repository at this point in the history
…pache#72)

* Refine logging level in different profiles

* Console logs are no longer recorded

* Reorder packages to avoid overwriting
  • Loading branch information
Pil0tXia committed Mar 19, 2024
1 parent 7aec4fe commit 1dfc379
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 120 deletions.
11 changes: 4 additions & 7 deletions deployment/auto-deploy-eventmesh-dashboard.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ PID_LOG=~/service/eventmesh-dashboard/deployment/eventmesh-dashboard-pid.log
# Automatic deployment shell script log file path
AUTO_DEPLOY_LOG=~/service/eventmesh-dashboard/deployment/auto-deploy-eventmesh-dashboard.log

# EventMesh Dashboard log file path
APP_LOG=~/service/eventmesh-dashboard/deployment/eventmesh-dashboard-$(date +"%Y-%m-%d-%H-%M-%S").log

# Jar file path
JAR_FILE_PATH=~/service/eventmesh-dashboard/eventmesh-dashboard-console/target/eventmesh-dashboard-console-0.0.1-SNAPSHOT.jar

Expand Down Expand Up @@ -62,8 +59,8 @@ if [ $LOCAL != $REMOTE ]; then
# Compile and package the Jar file
mvn clean package -DskipTests

# Start the springboot application and record the process id to pid.log file, redirect console logs to eventmesh-dashboard-<current time>.log file
nohup java -DDB_ADDRESS=$DB_ADDRESS -DDB_USERNAME=$DB_USERNAME -DDB_PASSWORD=$DB_PASSWORD -jar $JAR_FILE_PATH > $APP_LOG 2>&1 &
# Start the springboot application and record the process id to pid.log file
nohup java -DDB_ADDRESS=$DB_ADDRESS -DDB_USERNAME=$DB_USERNAME -DDB_PASSWORD=$DB_PASSWORD -jar $JAR_FILE_PATH > /dev/null 2>&1 &
echo $! > $PID_LOG

# Log the event
Expand All @@ -81,8 +78,8 @@ else
# If the pid.log file does not exist, compile and package the Jar file
mvn clean package -DskipTests

# Start the springboot application and record the process id to pid.log file, redirect console logs to eventmesh-dashboard-<current time>.log file
nohup java -DDB_ADDRESS=$DB_ADDRESS -DDB_USERNAME=$DB_USERNAME -DDB_PASSWORD=$DB_PASSWORD -jar $JAR_FILE_PATH > $APP_LOG 2>&1 &
# Start the springboot application and record the process id to pid.log file
nohup java -DDB_ADDRESS=$DB_ADDRESS -DDB_USERNAME=$DB_USERNAME -DDB_PASSWORD=$DB_PASSWORD -jar $JAR_FILE_PATH > /dev/null 2>&1 &
echo $! > $PID_LOG

# Log the event
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ spring:
min-evictable-idle-time-millis: 300000

logging:
config: classpath:logback-dev.xml
level:
root: INFO
org.apache.eventmesh: DEBUG
org.apache.eventmesh.dashboard: DEBUG

mybatis:
type-aliases-package: org.apache.eventmesh.dashboard.console.entity
Expand Down
50 changes: 0 additions & 50 deletions eventmesh-dashboard-console/src/main/resources/logback-dev.xml

This file was deleted.

17 changes: 6 additions & 11 deletions eventmesh-dashboard-console/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,20 @@
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder charset="UTF-8">
<pattern>[%d{yyyy-MM-dd HH:mm:ss.SSS}] %p %t - %m%n</pattern>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %magenta(%-5level) %green(%logger{60}) - %msg%n</pattern>
</encoder>
</appender>

<appender name="FILE"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${user.home}/logs/eventmesh-dashboard.log</file>
<append>true</append>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${user.home}/logs/eventmesh-dashboard-%d{yyyy-MM-dd}.%i.log
</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>104857600</maxFileSize>
<fileNamePattern>${user.home}/logs/eventmesh-dashboard/eventmesh-dashboard-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>10485760</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<MaxHistory>10</MaxHistory>
</rollingPolicy>
<encoder>
<pattern>[%d{yyyy-MM-dd HH:mm:ss.SSS}] %p %t - %m%n</pattern>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{60} - %msg%n</pattern>
<charset class="java.nio.charset.Charset">UTF-8</charset>
</encoder>
</appender>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,8 @@ spring:
validation-query-timeout: 15
test-on-borrow: false
test-while-idle: true
min-evictable-idle-time-millis: 300000
min-evictable-idle-time-millis: 300000

logging:
level:
root: DEBUG
50 changes: 0 additions & 50 deletions eventmesh-dashboard-console/src/test/resources/logback-test.xml

This file was deleted.

0 comments on commit 1dfc379

Please sign in to comment.