File tree 3 files changed +37
-13
lines changed
kotlin/no/nav/klage/oppgave/config
3 files changed +37
-13
lines changed Original file line number Diff line number Diff line change
1
+ package no.nav.klage.oppgave.config
2
+
3
+ import ch.qos.logback.classic.Level
4
+ import ch.qos.logback.classic.Logger
5
+ import ch.qos.logback.classic.turbo.TurboFilter
6
+ import ch.qos.logback.core.spi.FilterReply
7
+ import no.nav.klage.oppgave.util.getLogger
8
+ import org.slf4j.Marker
9
+
10
+ class InternalLogFilter : TurboFilter () {
11
+
12
+ companion object {
13
+ @Suppress(" JAVA_CLASS_ON_COMPANION" )
14
+ private val ourLogger = getLogger(javaClass.enclosingClass)
15
+ }
16
+
17
+ override fun decide (
18
+ marker : Marker ? ,
19
+ logger : Logger ? ,
20
+ level : Level ? ,
21
+ format : String? ,
22
+ params : Array <out Any >? ,
23
+ throwable : Throwable ?
24
+ ): FilterReply {
25
+ if (level == Level .DEBUG && logger?.name == " org.springframework.web.filter.CommonsRequestLoggingFilter" &&
26
+ (format?.contains(" request [GET /internal/prometheus" ) == true ||
27
+ format?.contains(" request [GET /internal/health" ) == true )
28
+ ) {
29
+ return FilterReply .DENY
30
+ }
31
+
32
+ return FilterReply .NEUTRAL
33
+ }
34
+ }
Original file line number Diff line number Diff line change 8
8
add-mappings : false
9
9
mvc :
10
10
throw-exception-if-no-handler-found : true
11
- log-request-details : true
12
11
datasource :
13
12
url : jdbc:postgresql://${NAIS_DATABASE_KABAL_API_KABAL_API_HOST}:${NAIS_DATABASE_KABAL_API_KABAL_API_PORT}/${NAIS_DATABASE_KABAL_API_KABAL_API_DATABASE}
14
13
username : ${NAIS_DATABASE_KABAL_API_KABAL_API_USERNAME}
Original file line number Diff line number Diff line change 3
3
<include resource =" org/springframework/boot/logging/logback/defaults.xml" />
4
4
5
5
<turboFilter class =" no.nav.klage.oppgave.config.SseBrokenPipeLogFilter" />
6
+ <turboFilter class =" no.nav.klage.oppgave.config.InternalLogFilter" />
6
7
7
8
<springProfile name =" local" >
8
9
<appender name =" text" class =" ch.qos.logback.core.ConsoleAppender" >
46
47
<rollingPolicy class =" ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy" >
47
48
<fileNamePattern >/secure-logs/secure.log.%d{yyyy-MM-dd}.%i</fileNamePattern >
48
49
<maxHistory >30</maxHistory >
49
- <minIndex >1</minIndex >
50
- <maxIndex >4</maxIndex >
51
- <maxFileSize >30MB</maxFileSize >
52
- <totalSizeCap >115MB</totalSizeCap >
50
+ <maxFileSize >26MB</maxFileSize >
51
+ <totalSizeCap >100MB</totalSizeCap >
53
52
</rollingPolicy >
54
53
<encoder class =" net.logstash.logback.encoder.LogstashEncoder" />
55
54
</appender >
70
69
<appender-ref ref =" secureJson" />
71
70
</logger >
72
71
73
- <logger name =" org.springframework.web.servlet.DispatcherServlet" level =" trace" additivity =" false" >
74
- <appender-ref ref =" secureJson" />
75
- </logger >
76
-
77
72
<logger name =" reactor.netty.http.client" level =" debug" additivity =" false" >
78
73
<appender-ref ref =" secureJson" />
79
74
</logger >
80
75
81
- <logger name =" org.springframework.data.elasticsearch.client" level =" trace" additivity =" false" >
82
- <appender-ref ref =" secureJson" />
83
- </logger >
84
-
85
76
<logger name =" org.springframework.data.convert.CustomConversions" level =" error" />
86
77
87
78
<logger name =" no.nav.security.token.support" level =" debug" additivity =" false" >
You can’t perform that action at this time.
0 commit comments