public class LoggingSupport extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
LoggingSupport.Ident
The ident portion of the log line (comes between the record ID and the log message type).
|
| Modifier and Type | Field and Description |
|---|---|
protected static AtomicLong |
rid |
| Constructor and Description |
|---|
LoggingSupport() |
| Modifier and Type | Method and Description |
|---|---|
protected static void |
appendEscaped(Object o,
StringBuilder out) |
protected static String |
buildLogLine(String type,
int version,
LoggingSupport.Ident ident,
Object... args) |
static void |
debug(org.slf4j.Logger logger,
String type,
int version,
LoggingSupport.Ident ident,
Object... args)
Generate a new debug log message according to the Spotify log format.
|
static void |
error(org.slf4j.Logger logger,
String type,
int version,
LoggingSupport.Ident ident,
Object... args)
Generate a new error log message according to the Spotify log format.
|
static void |
info(org.slf4j.Logger logger,
String type,
int version,
LoggingSupport.Ident ident,
Object... args)
Generate a new info log message according to the Spotify log format.
|
static void |
warn(org.slf4j.Logger logger,
String type,
int version,
LoggingSupport.Ident ident,
Object... args)
Generate a new warn log message according to the Spotify log format.
|
protected static final AtomicLong rid
public static void debug(org.slf4j.Logger logger,
String type,
int version,
LoggingSupport.Ident ident,
Object... args)
logger - Which Logger to use for writing the log messages. It is assumed that this Logger
is already set up via com.spotify.logging.LoggingConfigurator and a
[service]-log4j.xml configuration so that the time stamp, hostname, service, and
process ID portions of the log message are automatically prepended.type - Log message type. Log messages are defined in the messages.py module in the
log-parser git project. When a new message type is added or changed in a
service, it should also be changed/added in messages.py.version - Version of the log message. This is incremented by callers and in messages.py if
the format of a given log message type is changed.ident - Ident object to give information generally about a client who made the request
that resulted in this message.args - Additional arguments that will be converted to strings, escaped, and appended
(tab-separated) after the log message type and version number.public static void info(org.slf4j.Logger logger,
String type,
int version,
LoggingSupport.Ident ident,
Object... args)
for parameter descriptions.public static void warn(org.slf4j.Logger logger,
String type,
int version,
LoggingSupport.Ident ident,
Object... args)
for parameter descriptions.public static void error(org.slf4j.Logger logger,
String type,
int version,
LoggingSupport.Ident ident,
Object... args)
for parameter descriptions.protected static String buildLogLine(String type, int version, LoggingSupport.Ident ident, Object... args)
protected static void appendEscaped(Object o, StringBuilder out)
Copyright © 2016. All Rights Reserved.