forked from thoughtworks/HeartBeat
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(log): add backend log rolling file strategy
- Loading branch information
1 parent
33e3f22
commit f82ced8
Showing
3 changed files
with
19 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,3 +35,5 @@ out/ | |
|
||
### VS Code ### | ||
.vscode/ | ||
|
||
logs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,29 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Configuration status="WARN" monitorInterval="30"> | ||
<Configuration status="INFO" name="Heartbeat"> | ||
<Properties> | ||
<Property name="LOG_PATTERN"> | ||
%d{yyyy-MM-dd HH:mm:ss.SSS} [%highlight{%-5level}{FATAL=bg_red, ERROR=red, WARN=yellow, INFO=green}] [%t] %M(%c{1}:%L): %m%n%ex | ||
</Property> | ||
</Properties> | ||
|
||
<Appenders> | ||
<Console name="ConsoleAppender" target="SYSTEM_OUT" follow="true"> | ||
<PatternLayout pattern="${LOG_PATTERN}"/> | ||
</Console> | ||
<Console name="ConsoleAppender" target="SYSTEM_OUT" follow="true"> | ||
<PatternLayout pattern="${LOG_PATTERN}"/> | ||
</Console> | ||
<RollingFile name="RollingFile" fileName="logs/Heartbeat.log" | ||
filePattern="logs/Heartbeat-%d{MM-dd-yyyy}-%i.log.gz"> | ||
<PatternLayout> | ||
<Pattern>%d %p %c{1.} [%t] %m%n</Pattern> | ||
</PatternLayout> | ||
<Policies> | ||
<SizeBasedTriggeringPolicy size="10 MB" /> | ||
</Policies> | ||
<DefaultRolloverStrategy max="10"/> | ||
</RollingFile> | ||
</Appenders> | ||
|
||
<Loggers> | ||
<Root level="info"> | ||
<AppenderRef ref="RollingFile"/> | ||
<AppenderRef ref="ConsoleAppender"/> | ||
</Root> | ||
</Loggers> | ||
</Configuration> | ||
</Configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters