Skip to content

Commit

Permalink
OPHYK-212 Log access log to stdout
Browse files Browse the repository at this point in the history
  • Loading branch information
rce committed Dec 5, 2024
1 parent c587f04 commit 7d43672
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions organisaatio-service/src/main/resources/logback-access.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
<configuration>
<appender name="ACCESS" class="ch.qos.logback.core.rolling.RollingFileAppender">
<append>true</append>
<appender name="ACCESS-CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<charset>utf-8</charset>
<!-- Can't use %X{requestId} because of this; log the X-Request-Id header instead which is used as requestId if found: https://jira.qos.ch/browse/LOGBACK-1016 -->
<pattern>{&quot;timestamp&quot;: &quot;%t{yyyy-MM-dd'T'HH:mm:ss.SSSZ}&quot;, &quot;requestId&quot;: &quot;%i{X-Request-Id}&quot;, &quot;responseCode&quot;: &quot;%s&quot;, &quot;request&quot;: &quot;%r&quot;, &quot;responseTime&quot;: &quot;%D&quot;, &quot;requestMethod&quot;: &quot;%m&quot;, &quot;service&quot;: &quot;organisaatio&quot;, &quot;environment&quot;: &quot;${name}&quot;, &quot;customer&quot;: &quot;OPH&quot;, &quot;user-agent&quot;: &quot;%i{User-Agent}&quot;, &quot;clientSubSystemCode&quot;: &quot;%i{clientSubSystemCode}&quot;, &quot;caller-id&quot;: &quot;%i{Caller-Id}&quot;, &quot;x-forwarded-for&quot;: &quot;%i{X-Forwarded-For}&quot;, &quot;remote-ip&quot;: &quot;%a&quot;, &quot;session&quot;: &quot;%reqCookie{JSESSIONID}&quot;, &quot;response-size&quot;: &quot;%B&quot;, &quot;referer&quot;: &quot;%i{Referer}&quot;, &quot;opintopolku-api-key&quot;: &quot;%i{Opintopolku-Api-Key}&quot;}</pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${user.home}/logs/localhost_access_log.%d{yyyy-MM-dd}.txt</fileNamePattern>
<maxHistory>7</maxHistory>
</rollingPolicy>
</appender>
<appender-ref ref="ACCESS"/>
<appender-ref ref="ACCESS-CONSOLE"/>
</configuration>

0 comments on commit 7d43672

Please sign in to comment.