Skip to content

Commit

Permalink
Add default logging configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
worldwise001 committed Aug 18, 2024
1 parent 7349833 commit 91d5279
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/main/resources/log4j2-debug.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Configuration:
name: Default
Appenders:
Console:
name: ConsoleAppender
target: SYSTEM_OUT
PatternLayout:
pattern: "%d{yyyy-MM-dd HH:mm:ss.SSS} %t [%-5level] %c{1}.%M:%L - %msg%n"
Loggers:
Root:
level: debug
AppenderRef:
- ref: ConsoleAppender
25 changes: 25 additions & 0 deletions src/main/resources/log4j2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Configuration:
name: Default
Properties:
Property:
name: log-path
value: "logs"
Appenders:
Console:
name: ConsoleAppender
target: SYSTEM_OUT
PatternLayout:
pattern: "%d{yyyy-MM-dd HH:mm:ss.SSS} %t [%-5level] %c{1} - %msg%n"
File:
name: FileAppender
fileName: ${log-path}/logfile.log
PatternLayout:
pattern: "%d{yyyy-MM-dd HH:mm:ss.SSS} %t [%-5level] %c{1} - %msg%n"
Loggers:
Root:
level: warning
AppenderRef:
- ref: ConsoleAppender
level: info
- ref: FileAppender
level: warning
13 changes: 13 additions & 0 deletions src/test/resources/log4j2-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Configuration:
name: Default
Appenders:
Console:
name: ConsoleAppender
target: SYSTEM_OUT
PatternLayout:
pattern: "%d{yyyy-MM-dd HH:mm:ss.SSS} %t [%-5level] %c{1}.%M:%L - %msg%n"
Loggers:
Root:
level: debug
AppenderRef:
- ref: ConsoleAppender

0 comments on commit 91d5279

Please sign in to comment.