Documentation ¶
Index ¶
- type Logger
- func (l *Logger) Debug(args ...interface{})
- func (l *Logger) Debugf(log string, args ...interface{})
- func (l *Logger) Error(args ...interface{})
- func (l *Logger) Fatal(args ...interface{})
- func (l *Logger) Flush()
- func (l *Logger) Info(args ...interface{})
- func (l *Logger) Panic(args ...interface{})
- func (l *Logger) Warn(args ...interface{})
- func (l *Logger) WithContext(ctx context.Context) flamingo.Logger
- func (l *Logger) WithCorrelationID(cid string) flamingo.Logger
- func (l *Logger) WithField(key flamingo.LogKey, value interface{}) flamingo.Logger
- func (l *Logger) WithFields(fields map[flamingo.LogKey]interface{}) flamingo.Logger
- type Module
- type ShutdownEventSubscriber
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
Logger is a Wrapper for the zap logger fulfilling the flamingo.Logger interface
func (*Logger) Debug ¶
func (l *Logger) Debug(args ...interface{})
Debug logs a message at debug level
func (*Logger) Error ¶
func (l *Logger) Error(args ...interface{})
Error logs a message at error level
func (*Logger) Fatal ¶
func (l *Logger) Fatal(args ...interface{})
Fatal logs a message at fatal level The logger then calls os.Exit(1), even if logging at FatalLevel is disabled.
func (*Logger) Flush ¶
func (l *Logger) Flush()
Flush is used by buffered loggers and triggers the actual writing. It is a good habit to call Flush before letting the process exit. For the top level flamingo.Logger, this is called by the app itself.
func (*Logger) Panic ¶
func (l *Logger) Panic(args ...interface{})
Panic logs a message at panic level The logger then panics, even if logging at PanicLevel is disabled.
func (*Logger) WithContext ¶
WithContext returns a logger with fields filled from the context businessId: From Header X-Business-ID client_ip: From Header X-Forwarded-For or request if header is empty correlationId: The ID of the context method: HTTP verb from request path: URL path from request referer: referer from request request: received payload from request
func (*Logger) WithCorrelationID ¶
WithCorrelationID returns a logger with a correlation ID field
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module for logrus logging
func (*Module) Configure ¶
Configure the logrus logger as flamingo.Logger (in JSON mode kibana compatible)
func (*Module) DefaultConfig ¶
DefaultConfig for zap log level
func (*Module) Inject ¶
func (m *Module) Inject(config *struct { Area string `inject:"config:area"` JSON bool `inject:"config:zap.json,optional"` LogLevel string `inject:"config:zap.loglevel,optional"` ColoredOutput bool `inject:"config:zap.colored,optional"` DevelopmentMode bool `inject:"config:zap.devmode,optional"` SamplingEnabled bool `inject:"config:zap.sampling.enabled,optional"` SamplingInitial float32 `inject:"config:zap.sampling.initial,optional"` SamplingThereafter float32 `inject:"config:zap.sampling.thereafter,optional"` })
Inject dependencies
type ShutdownEventSubscriber ¶
type ShutdownEventSubscriber struct {
// contains filtered or unexported fields
}
ShutdownEventSubscriber handles the logger sync on flamingo shutdown
func (*ShutdownEventSubscriber) Inject ¶
func (subscriber *ShutdownEventSubscriber) Inject(logger flamingo.Logger)
Inject dependencies