LogFormatUtils class abstract final

Formats values for log lines: what the framework writes about values from outside (a path, a user name, a header) goes through it.

A value from a client can hold line breaks and terminal escapes: logged as it is, ada\nINFO ... root logged in would add a forged line to the log, and an escape code would change what a terminal shows. formatValue replaces them, and cuts long values.

Spring (Java): org.springframework.core.log.LogFormatUtils.

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

formatValue(Object? value, {int maxLength = 100, bool replaceNewlinesAndControlCharacters = true}) → String
value for a log line: a String in quotes, null as null, anything else by toString(); cut to maxLength characters (-1: no limit) followed by (truncated)...; with replaceNewlinesAndControlCharacters (the default here), \n and \r as <EOL> and every other control character (\p{Cc}, escape codes included) as ?, as Spring.