Skip to main content

Configuration with HOCON

Klogging can be configured from HOCON files. This example is exactly equivalent to the first DSL example:

{
sinks = {
stdout = {
renderWith = RENDER_SIMPLE
sendTo = STDOUT
},
seq = {
seqServer = "http://localhost:5341"
}
},
logging = [
{
fromLoggerBase = com.example
levelRanges = [
{
fromMinLevel = INFO
toSinks = [stdout]
}
]
}
]
}
caution

Klogging uses the KotlinX serialization library for HOCON, which has limited capability. In future it will support more HOCON features.

Configuration object names

Names are exactly the same as for JSON.