Add MyCustomFormat.kt example to documentation

Closes gh-42594
This commit is contained in:
Moritz Halbritter 2024-10-11 13:45:16 +02:00
parent 8aee3e1e92
commit bd036eb29f
1 changed files with 12 additions and 0 deletions

View File

@ -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"
}
}