audit

package
v1.5.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2017 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogEntryType     = "openshift.logger"
	AuditUserEntry   = "openshift.auth.user"
	AuditUserIDEntry = "openshift.auth.userid"
	AuditStatusEntry = "openshift.request.status"
	AuditErrorEntry  = "openshift.request.error"

	DefaultLoggerType = "registry"
	AuditLoggerType   = "audit"

	OpStatusBegin = "begin"
	OpStatusError = "error"
	OpStatusOK    = "success"
)

Variables

This section is empty.

Functions

func LoggerExists

func LoggerExists(ctx context.Context) (exists bool)

LoggerExists checks audit logger existence.

func WithLogger

func WithLogger(ctx context.Context, logger *AuditLogger) context.Context

WithLogger creates a new context with provided logger.

Types

type AuditLogger

type AuditLogger struct {
	// contains filtered or unexported fields
}

AuditLogger implements special audit log. We can't use the system logger because the change of log level can hide the audit logs.

func GetLogger

func GetLogger(ctx context.Context) *AuditLogger

GetLogger returns the logger from the current context, if present. It will be created otherwise.

func MakeAuditLogger

func MakeAuditLogger(ctx context.Context) *AuditLogger

MakeAuditLogger returns new audit logger which inherits fields from the system logger.

func (*AuditLogger) Log

func (l *AuditLogger) Log(args ...interface{})

Log logs record.

func (*AuditLogger) LogResult

func (l *AuditLogger) LogResult(err error, args ...interface{})

LogResult logs record with additional operation status.

func (*AuditLogger) LogResultf

func (l *AuditLogger) LogResultf(err error, format string, args ...interface{})

LogResultf formats record according to a format with additional operation status.

func (*AuditLogger) Logf

func (l *AuditLogger) Logf(format string, args ...interface{})

Logf formats record according to a format.

func (*AuditLogger) SetFormatter

func (l *AuditLogger) SetFormatter(formatter logrus.Formatter)

SetFormatter sets the audit logger formatter.

Jump to

Keyboard shortcuts

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