Skip to content

Commit

Permalink
#135 | Application Logs Have Been Wrote to Text Files for Reading Log…
Browse files Browse the repository at this point in the history
…s from Server (#173)
  • Loading branch information
agitrubard authored Sep 18, 2023
1 parent e4fc7ea commit 9e191dd
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,5 @@ build/
## We should not commit this to prevent leaking confidential information
.env

settings.xml
settings.xml
/.logs
5 changes: 3 additions & 2 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ server:

logging:
level:
web: debug
web: ${AYS_LOG_LEVEL:debug}
sql: ${AYS_LOG_LEVEL:debug}

spring:
liquibase:
enabled: true
changeLog: "classpath:db/changelog/db.changelog-master.yaml"
drop-first: ${LIQUIBASE_ENABLE_DROP_FIRST:false}
drop-first: ${AYS_LIQUIBASE_ENABLE_DROP_FIRST:false}
jpa:
properties:
hibernate:
Expand Down
30 changes: 30 additions & 0 deletions src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>

<configuration scan="true">
<include resource="org/springframework/boot/logging/logback/base.xml"/>

<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<prudent>true</prudent>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>.logs/be/ays_%d{ddMMyyyy}.log</fileNamePattern>
</rollingPolicy>
<encoder>
<charset>utf-8</charset>
<Pattern>%d %-5level [%thread] %logger{0}: %msg%n</Pattern>
</encoder>
</appender>

<appender name="ASYNC" class="ch.qos.logback.classic.AsyncAppender">
<queueSize>512</queueSize>
<appender-ref ref="FILE"/>
</appender>

<contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
<resetJUL>true</resetJUL>
</contextListener>

<root level="INFO">
<appender-ref ref="ASYNC"/>
</root>

</configuration>

0 comments on commit 9e191dd

Please sign in to comment.