Package-level declarations

Klogging configuration, from DSL or JSON files.

Klogging configuration, from DSL or JSON files.

Types

Link copied to clipboard
annotation class ConfigDsl

Marker annotation for DSL functions.

Link copied to clipboard
@Serializable
data class FileConfiguration(val configName: String? = null, val kloggingMinLogLevel: Level = defaultKloggingMinLogLevel, val minDirectLogLevel: Level = defaultMinDirectLogLevel, val sinks: Map<String, FileSinkConfiguration> = mapOf(), val logging: List<FileLoggingConfig> = listOf(), val baseContext: Map<String, String> = mapOf())

Data class for file representation of KloggingConfiguration, either in JSON or HOCON format.

Link copied to clipboard
@Serializable
data class FileLevelRange(val fromMinLevel: Level? = null, val toMaxLevel: Level? = null, val atLevel: Level? = null, val toSinks: List<String>? = null)

Data class for a file representation of a LevelRange.

Link copied to clipboard
@Serializable
data class FileLoggingConfig(val fromLoggerBase: String? = null, val stopOnMatch: Boolean? = false, val exactLogger: String? = null, val matchLogger: String? = null, val levelRanges: List<FileLevelRange>)

Data class for a file representation of a LoggingConfig.

Link copied to clipboard
@Serializable
data class FileSinkConfiguration(val renderWith: String? = null, val renderPattern: String? = null, val sendTo: String? = null, val seqServer: String? = null, val apiKey: String? = null, val checkCertificate: Boolean? = null, val splunkServer: SplunkEndpoint? = null, val renderHec: RenderHec? = null, val eventSender: String? = null)

Data class for a file representation of a SinkConfiguration.

Link copied to clipboard
Link copied to clipboard

Object to manage Klogging configuration from JSON files.

Link copied to clipboard

Klogging configuration for a runtime.

Link copied to clipboard

Inclusive range of logging levels with the names of sinks where events will be sent.

Link copied to clipboard

Logging configuration with a logger name match and a list of level ranges that maps to a list of sinks for each.

Link copied to clipboard
@Serializable
data class RenderHec(val index: String? = null, val sourceType: String? = null, val source: String? = null)

Data class for file representation of a RenderHec.

Link copied to clipboard
data class SinkConfiguration(renderer: RenderString = RENDER_SIMPLE, stringSender: SendString = STDOUT, eventSender: EventSender = senderFrom(renderer, stringSender))

Configuration of a logging sink, comprising a sender and a renderer.

Properties

Link copied to clipboard

Simple default configuration for logging ANSI-coloured strings to the standard output stream.

Link copied to clipboard

Simple default configuration for logging ANSI-coloured strings to the standard error stream.

Link copied to clipboard

Lazily load configuration from a file.

Link copied to clipboard

Simple default configuration for logging to the standard output stream.

Link copied to clipboard

Simple default configuration for logging to the standard error stream.

Link copied to clipboard

Simple sink configuration for rendering ANSI-coloured strings to the standard error stream.

Link copied to clipboard

Simple sink configuration for rendering simple strings to the standard error stream.

Link copied to clipboard

Simple sink configuration for rendering ANSI-coloured strings to the standard output stream.

Link copied to clipboard

Simple sink configuration for rendering simple strings to the standard output stream.

Functions

Link copied to clipboard
fun evalEnv(string: String, env: Map<String, String> = ENV): String

Evaluate env vars in a string. Env vars must be surrounded by braces and preceded with ‘$’, e.g. ${KLOGGING_BLAH}.

Link copied to clipboard
fun getenv(name: String): String?

Return the value of an item in the running environment, or null if the name is not found.

fun getenv(name: String, default: String): String

Return the value of an item in the running environment, or a default value if not found.

Link copied to clipboard
fun getenvBoolean(name: String, default: Boolean): Boolean

Return the value of an item in the running environment as a Boolean, or a default value if not found.

Link copied to clipboard
fun getenvInt(name: String, default: Int, minValue: Int = 1): Int

Return the value of an item in the running environment as an Int, or a default value if not found or if the value cannot be parsed as an Int.

Link copied to clipboard
fun getenvLong(name: String, default: Long, minValue: Long = 1): Long

Return the value of an item in the running environment as a Long, or a default value if not found or if the value cannot be parsed as a Long.

Link copied to clipboard
fun graylog(host: String, port: Int, renderer: RenderString = RENDER_GELF): SinkConfiguration

Sink configuration for a Graylog server.

Link copied to clipboard
fun loggingConfiguration(append: Boolean = false, block: KloggingConfiguration.() -> Unit)

Root DSL function for creating a KloggingConfiguration.

Link copied to clipboard
fun seq(url: String, apiKey: String? = null, checkCertificate: Boolean = false, renderer: RenderString = RENDER_CLEF): SinkConfiguration

Sink configuration for a Seq server.