logger

package
v1.27.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 30, 2021 License: Apache-2.0, BSD-2-Clause, MIT, + 1 more Imports: 6 Imported by: 153

Documentation

Index

Constants

View Source
const IDFieldName = "process_id"

IDFieldName is the name of the id field for a logger.

Variables

View Source
var Logger *logrus.Logger

Logger is the standard logger for the Gardener which is used for all messages which are not Shoot cluster specific.

Functions

func AddWriter

func AddWriter(logger *logrus.Logger, writer io.Writer) *logrus.Logger

AddWriter returns a logger that uses the tests writer (e.g., GingkoWriter) as output channel

func NewFieldLogger

func NewFieldLogger(logger logrus.FieldLogger, fieldKey, fieldValue string) *logrus.Entry

NewFieldLogger extends an existing logrus logger and adds the provided additional field. Example output: time="2017-06-08T13:00:49+02:00" level=info msg="something" <fieldKey>=<fieldValue>.

func NewIDLogger added in v1.14.0

func NewIDLogger(logger logrus.FieldLogger) logrus.FieldLogger

NewIDLogger extends an existing logrus logger with a randomly generated id field. Example output: time="2017-06-08T13:00:49+02:00" level=info msg="something" id=123abcde.

func NewLogger

func NewLogger(logLevel string) *logrus.Logger

NewLogger creates a new logrus logger. It uses STDERR as output channel and evaluates the value of the --log-level command line argument in order to set the log level. Example output: time="2017-06-08T13:00:28+02:00" level=info msg="gardener started successfully".

func NewNopLogger added in v0.34.0

func NewNopLogger() *logrus.Logger

NewNopLogger instantiates a new logger that logs to ioutil.Discard.

func NewShootLogger

func NewShootLogger(logger *logrus.Logger, shoot, project string) *logrus.Entry

NewShootLogger extends an existing logrus logger and adds an additional field containing the Shoot cluster name and the project in the Garden cluster to the output. If an <operationID> is provided it will be printed for every log message. Example output: time="2017-06-08T13:00:49+02:00" level=info msg="Creating namespace in seed cluster" shoot=core/crazy-botany.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL