Browse Source

Add MyCustomFormat.kt example to documentation

Closes gh-42594
pull/42599/head
Moritz Halbritter 1 year ago
parent
commit
bd036eb29f
  1. 12
      spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/logging/structured/otherformats/MyCustomFormat.kt

12
spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/logging/structured/otherformats/MyCustomFormat.kt

@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
package org.springframework.boot.docs.features.logging.structured.otherformats
import ch.qos.logback.classic.spi.ILoggingEvent
import org.springframework.boot.logging.structured.StructuredLogFormatter
class MyCustomFormat : StructuredLogFormatter<ILoggingEvent> {
override fun format(event: ILoggingEvent): String {
return "time=${event.instant} level=${event.level} message=${event.message}\n"
}
}
Loading…
Cancel
Save