Add MyCustomFormat.kt example to documentation
Closes gh-42594
This commit is contained in:
parent
8aee3e1e92
commit
bd036eb29f
|
@ -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…
Reference in New Issue