-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from ALEEF02/feature/logging
Feature/logging
- Loading branch information
Showing
5 changed files
with
64 additions
and
10 deletions.
There are no files selected for viewing
Empty file.
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,2 +1,4 @@ | ||
/target/ | ||
*.cfg | ||
*.cfg | ||
.idea | ||
/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
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
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<configuration> | ||
<!-- Console Appender --> | ||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> | ||
<encoder> | ||
<pattern>%d{yyyy-MM-dd HH:mm:ss} %-5level %logger{36} - %msg%n</pattern> | ||
</encoder> | ||
</appender> | ||
|
||
<!-- General Log File Appender --> | ||
<appender name="FILE" class="ch.qos.logback.core.FileAppender"> | ||
<file>logs/application.log</file> | ||
<append>true</append> <!-- Append to file instead of overwriting --> | ||
<encoder> | ||
<pattern>%d{yyyy-MM-dd HH:mm:ss} %-5level %logger{36} - %msg%n</pattern> | ||
</encoder> | ||
</appender> | ||
|
||
<!-- Error Log File Appender --> | ||
<appender name="ERROR_FILE" class="ch.qos.logback.core.FileAppender"> | ||
<file>logs/error.log</file> | ||
<append>true</append> | ||
<encoder> | ||
<pattern>%d{yyyy-MM-dd HH:mm:ss} %-5level %logger{36} - %msg%n</pattern> | ||
</encoder> | ||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter"> | ||
<level>ERROR</level> <!-- Only logs at ERROR level will be written --> | ||
</filter> | ||
</appender> | ||
|
||
<!-- Root Logger Configuration --> | ||
<root level="info"> | ||
<appender-ref ref="STDOUT" /> <!-- Logs to console --> | ||
<appender-ref ref="FILE" /> <!-- Logs to general log file --> | ||
<appender-ref ref="ERROR_FILE" /> <!-- Logs to error-specific file --> | ||
</root> | ||
</configuration> |