package
0.0.0-20200513085925-1d97044de574
Repository: https://github.com/ver13/ava.git
Documentation: pkg.go.dev

# README

logger

Levels

The following table defines the log levels and messages in logger, in decreasing order of severity. The left column lists the log level designation in and the right column provides a brief description of each log level.

LevelDescription
FatalSevere errors that cause premature termination.
Expect these to be immediately visible on a status console.
ErrorOther runtime errors or unexpected conditions.
Expect these to be immediately visible on a status console.
Critical
WarnUse of deprecated APIs, poor use of APIConfig, 'almost' errors, other runtime situations that are undesirable or unexpected, but not necessarily "wrong".
Expect these to be immediately visible on a status console.
InfoInteresting runtime events (startup/shutdown).
Expect these to be immediately visible on a console, so be conservative and keep to a minimum.
DebugDetailed information on the flow through the system.
Expect these to be written to logs only.
TraceMost detailed information.
Expect these to be written to logs only.

Colors

The supported keys in the :colors keyword list are:

LevelColor
FatalDefaults to: Red
ErrorDefaults to: Red
CriticalDefaults to: LightRed
WarnDefaults to: Yellow
InfoDefaults to: Green
DebugDefaults to: Blue
TraceDefaults to: Magenta

See the IO.ANSI module for a list of colors and attributes.

For example, info takes precedence over debug. If your log level is set to info, info, warn, and error will be printed to the console. If your log level is set to warn, only warn and error will be printed.

Types

TypeFormat
Text%[levelName]s:%[name]s:%[message]s%[fields]s\n
Apache Common{host} {userIdentifier} {authUserId} [{datetime}] "{method} {request} HTTP/1.0" {responseCode} {bytes}
Apache Combined%[host]s - %[user]s %[authUserId]d [%[ASC_TIME]s] "%[method]s %[request]s HTTP/1.0" %[responseCode]d %[bytes]d "%[referrer]s" "%[agent]s"
Apache Error[{timestamp}] [{module}:{severity}] [pid {pid}:tid {threadID}] [client: %{client}] %{message}
RFC3164{timestamp} {hostname} {application}[{pid}]: {message}
RFC5424{version} {iso-timestamp} {hostname} {application} {pid} {message-id} {structured-data} {message}
Common Log File Format%[host]s - %[user]s %[authUserId]d [%[ASC_TIME]s] "%[method]s %[request]s HTTP/1.0" %[responseCode]d %[bytes]d

Metadata

In addition to the keys provided by the user via logger.metadata/1, the following extra keys are available to the :metadata list:

NameDescription
host
applicationThe current application
moduleThe current module
functionThe current function
fileThe current file
lineThe current line
pidThe current process identifier
threadID
user
authUserId
method
request
responseCode
bytes

# Packages

No description provided by the author
No description provided by the author

# Functions

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ParseLogFormatterType attempts to convert a string to a LogFormatterType.
ParseLogLevelType attempts to convert a string to a LogLevelType.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Constants

LogFormatterTypeApacheCombinedLog is a LogFormatterType of type ApacheCombinedLog.
LogFormatterTypeApacheCommonLog is a LogFormatterType of type ApacheCommonLog.
LogFormatterTypeApacheErrorLog is a LogFormatterType of type ApacheErrorLog.
LogFormatterTypeCommonLogFileFormat is a LogFormatterType of type CommonLogFileFormat.
LogFormatterTypeJSON is a LogFormatterType of type JSON.
LogFormatterTypeRFC3164Log is a LogFormatterType of type RFC3164Log.
LogFormatterTypeRFC5424Log is a LogFormatterType of type RFC5424Log.
LogFormatterTypeText is a LogFormatterType of type Text.
LogFormatterTypeUnknown is a LogFormatterType of type Unknown.
LogLevelTypeDebug is a LogLevelType of type Debug Debug level.
LogLevelTypeError is a LogLevelType of type Error Error level.
LogLevelTypeFatal is a LogLevelType of type Fatal Fatal level.
LogLevelTypeInfo is a LogLevelType of type Info Info level.
LogLevelTypePanic is a LogLevelType of type Panic Panic level, highest level of severity.
LogLevelTypeTrace is a LogLevelType of type Trace Trace level.
LogLevelTypeUnknown is a LogLevelType of type Unknown.
LogLevelTypeWarn is a LogLevelType of type Warn Warn level.

# Structs

No description provided by the author

# Interfaces

logger is the interface for loggers used in the AVA components.

# Type aliases

LogFormatterType x ENUM( Text JSON ApacheCommonLog ApacheCombinedLog ApacheErrorLog RFC3164Log RFC5424Log CommonLogFileFormat Unknown ).
LogLevelType x ENUM( Panic // Panic level, highest level of severity.