Skip to content

Commit bd036eb

Browse files
committed
Add MyCustomFormat.kt example to documentation
Closes gh-42594
1 parent 8aee3e1 commit bd036eb

File tree

1 file changed

+12
-0
lines changed
  • spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/features/logging/structured/otherformats

1 file changed

+12
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package org.springframework.boot.docs.features.logging.structured.otherformats
2+
3+
import ch.qos.logback.classic.spi.ILoggingEvent
4+
import org.springframework.boot.logging.structured.StructuredLogFormatter
5+
6+
class MyCustomFormat : StructuredLogFormatter<ILoggingEvent> {
7+
8+
override fun format(event: ILoggingEvent): String {
9+
return "time=${event.instant} level=${event.level} message=${event.message}\n"
10+
}
11+
12+
}

0 commit comments

Comments
 (0)