Package-level declarations

Rendering log events as JSON or plain text.

Types

Link copied to clipboard
class RenderPattern(pattern: String = "%m") : RenderString

RenderString implementation that interprets a string pattern of tokens specifying log event fields to show.

Link copied to clipboard
fun interface RenderString

Interface for rendering a LogEvent to a String.

Properties

Link copied to clipboard

Render a level in colour using ANSI colour escapes.

Link copied to clipboard

Extension property that extracts the list of items and stack trace if present in a LogEvent.

Link copied to clipboard
val Instant.localString: String

Extension property for Kotlin Instant to render it in local time as two words.

Link copied to clipboard
val Instant.localTime: String

Only the local time component.

Link copied to clipboard

Implementation of RenderString like that for Log4J2 with ANSI colouring of level output to a console.

Link copied to clipboard

Render a LogEvent into CLEF compact JSON format.

Link copied to clipboard

Render a LogEvent into JSON in Elastic Common Schema for sending directly to an ELK stack.

Link copied to clipboard

Render a LogEvent into JSON to mimic that described in Elastic Common Schema for .NET.

Link copied to clipboard

Renders a LogEvent into GELF JSON format.

Link copied to clipboard
Link copied to clipboard

Simple implementation of RenderString for output to the standard output stream, mostly on one line.

Link copied to clipboard

Render a LogEvent into structured JSON log format.

Functions

Link copied to clipboard
Link copied to clipboard

Extension function that replaces values of placeholders in the message field with values of items whose keys match them.

Link copied to clipboard
fun Instant.graylogFormat(): String
Link copied to clipboard
fun green(str: String): String
Link copied to clipboard
fun grey(str: String): String
Link copied to clipboard

Right-pads a character sequence within the specified width if it fits; else the right-most characters of that sequence.

Link copied to clipboard
fun red(str: String): String
Link copied to clipboard
fun renderAnsi(contextWidth: Int, loggerWidth: Int): RenderString

Implementation of RenderString like that for Log4J2 with ANSI colouring of level output to a console.

Link copied to clipboard
fun renderHec(index: String? = null, sourceType: String? = null, source: String? = null): RenderString

Renders an event into JSON format for Splunk HTTP Event Collector.

Link copied to clipboard

Right-align the string into a fixed-width space.

Link copied to clipboard

Serialize a map with string keys to JSON.

Link copied to clipboard
fun CharSequence.shortenName(width: Int = DEFAULT_MAX_WIDTH): CharSequence

Shortens the given name if it exceeds the specified width.

Link copied to clipboard

Shortens a character sequence and right-pads it if shorter than the specified width.

Link copied to clipboard
fun yellow(str: String): String