Documentation ¶
Index ¶
Constants ¶
View Source
const ( LogRoot = "/var/log/" + config.OrchestratorName LogRotationThreshold = 10485760 // 10 MB MaxLogEntryLength = 64000 )
Variables ¶
This section is empty.
Functions ¶
func InitLogLevel ¶
InitLogLevel configures the logging level. The debug flag takes precedence if set, otherwise the logLevel flag (debug, info, warn, error, fatal) is used.
func InitLogging ¶
InitLogging configures logging for nDVP. Logs are written both to a log file as well as stdout/stderr. Since logrus doesn't support multiple writers, each log stream is implemented as a hook.
Types ¶
type ConsoleHook ¶
type ConsoleHook struct {
// contains filtered or unexported fields
}
ConsoleHook sends log entries to stdout.
func NewConsoleHook ¶
func NewConsoleHook() *ConsoleHook
NewConsoleHook creates a new log hook for writing to stdout/stderr.
func (*ConsoleHook) Levels ¶
func (hook *ConsoleHook) Levels() []log.Level
type FileHook ¶
type FileHook struct {
// contains filtered or unexported fields
}
FileHook sends log entries to a file.
func NewFileHook ¶
NewFileHook creates a new log hook for writing to a file.
func (*FileHook) GetLocation ¶
type PlainTextFormatter ¶
type PlainTextFormatter struct { // TimestampFormat to use for display when a full timestamp is printed TimestampFormat string // The fields are sorted by default for a consistent output. For applications // that log extremely frequently and don't use the JSON formatter this may not // be desired. DisableSorting bool }
PlainTextFormatter is a formatter than does no coloring *and* does not insist on writing logs as key/value pairs.
Click to show internal directories.
Click to hide internal directories.