Skip to content

Commit

Permalink
logging
Browse files Browse the repository at this point in the history
  • Loading branch information
mettok committed Nov 14, 2024
1 parent af3d054 commit c60ab90
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .nais/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ spec:
cpu: "250m"
memory: "768Mi"
limits:
memory: "1024Mi"
memory: "1024Mi"
secureLogs:
enabled: true
22 changes: 18 additions & 4 deletions src/main/resources/logback.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,26 @@
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{YYYY-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
<encoder class="net.logstash.logback.encoder.LogstashEncoder" />
</appender>
<appender name="tjenestekall" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>/secure-logs/secure.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<fileNamePattern>/secure-logs/secure.log.%i</fileNamePattern>
<minIndex>1</minIndex>
<maxIndex>1</maxIndex>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<maxFileSize>128MB</maxFileSize>
</triggeringPolicy>
<encoder class="net.logstash.logback.encoder.LogstashEncoder" />
</appender>
<root level="debug">
<appender-ref ref="STDOUT"/>
</root>
<logger name="org.eclipse.jetty" level="INFO"/>
<logger name="io.netty" level="INFO"/>
</configuration>
<logger name="no.nav" level="DEBUG"/>
<logger name="tjenestekall" level="INFO" additivity="false">
<appender-ref ref="secureLog" />
</logger>
</configuration>

0 comments on commit c60ab90

Please sign in to comment.