Back to

Package log

Latest Go to latest

The highest tagged major version is .

Published: Jul 9, 2019 | License: AGPL-3.0 | Module:


Package log define and configure the Pydio loggers based on zap.

We mainly use 2 loggers that are defined in this package and used throughout the backend: - A syslog logger: it should be used to log technical information. - An audit logger: it only logs some very precise information at strategic places and is used to monitor the Application from a business point of view. Audit logs are among others used for GRDP compliance.

WARNING: you should not modify nor remove any of the audit log.



var (
	AuditLogger     *zap.Logger
	TasksLoggerImpl *zap.Logger
	StdOut          *os.File

func Auditer

func Auditer(ctx context.Context) *zap.Logger

Auditer returns a zap logger with as much context as possible

func Debug

func Debug(msg string, fields ...zapcore.Field)

func Error

func Error(msg string, fields ...zapcore.Field)

func Fatal

func Fatal(msg string, fields ...zapcore.Field)

func GetAuditId

func GetAuditId(msgId string) zapcore.Field

GetAuditId simply returns a zap field that contains this message id to ease audit log analysis.

func Info

func Info(msg string, fields ...zapcore.Field)

func Init

func Init()

func Logger

func Logger(ctx context.Context) *zap.Logger

Logger returns a zap logger with as much context as possible.

func RFC3369TimeEncoder

func RFC3369TimeEncoder(t time.Time, enc zapcore.PrimitiveArrayEncoder)

RFC3369TimeEncoder serializes a time.Time to an RFC3339-formatted string

func TasksLogger

func TasksLogger(ctx context.Context) *zap.Logger

TasksLogger returns a zap logger with as much context as possible.

type LogSyncer

type LogSyncer struct {
	// contains filtered or unexported fields

func NewLogSyncer

func NewLogSyncer(serviceName string) *LogSyncer

func (*LogSyncer) Write

func (l *LogSyncer) Write(p []byte) (n int, err error)

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier