Skip to content

Commit

Permalink
fix: don't store logs in files #405
Browse files Browse the repository at this point in the history
The Paketo Buildpacks images don't have permissions for the user running the application to write to the working directory anymore.
  • Loading branch information
fengelniederhammer committed Dec 11, 2023
1 parent adea131 commit 1ca90f7
Showing 1 changed file with 1 addition and 30 deletions.
31 changes: 1 addition & 30 deletions lapis2/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
@@ -1,36 +1,7 @@
<configuration>

<property name="LOG_FILE" value="LAPIS"/>
<property name="STATISTICS_LOG_FILE" value="statistics"/>
<property name="LOG_DIR" value="log"/>
<property name="PATTERN" value="%date %level [%thread] %class: %message%n"/>

<appender name="RollingFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_DIR}/${LOG_FILE}.log</file>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<Pattern>${PATTERN}</Pattern>
</encoder>

<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${LOG_DIR}/archived/${LOG_FILE}-%d{yyyy-MM-dd}.%i.gz</fileNamePattern>
<maxFileSize>10GB</maxFileSize>
<maxHistory>0</maxHistory>
</rollingPolicy>
</appender>

<appender name="StatisticsRollingFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_DIR}/${STATISTICS_LOG_FILE}.log</file>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<Pattern>%message%n</Pattern>
</encoder>

<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${LOG_DIR}/archived/${STATISTICS_LOG_FILE}-%d{yyyy-MM-dd}.%i.gz</fileNamePattern>
<maxFileSize>10GB</maxFileSize>
<maxHistory>0</maxHistory>
</rollingPolicy>
</appender>

<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>${PATTERN}</Pattern>
Expand All @@ -50,7 +21,7 @@
</root>

<logger name="StatisticsLogger" level="info" additivity="false">
<appender-ref ref="StatisticsRollingFile"/>
<appender-ref ref="STDOUT"/>
</logger>

</configuration>

0 comments on commit 1ca90f7

Please sign in to comment.