log

package
v0.0.0-...-8237a13 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2016 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetAuditLogger

func SetAuditLogger(logger *AuditLogger) (err error)

SetAuditLogger configures the singleton audit logger. This method must only be called once, and before calling GetAuditLogger the first time.

Types

type AuditLogger

type AuditLogger struct {
	SyslogWriter
	Stats statsd.Statter
	// contains filtered or unexported fields
}

AuditLogger implements SyslogWriter, and has additional audit-specific methods, like Audit(), for indicating which messages should be classified as audit events.

func GetAuditLogger

func GetAuditLogger() *AuditLogger

GetAuditLogger obtains the singleton audit logger. If SetAuditLogger has not been called first, this method initializes with basic defaults. The basic defaults cannot error, and subsequent access to an already-set AuditLogger also cannot error, so this method is error-safe.

func NewAuditLogger

func NewAuditLogger(log SyslogWriter, stats statsd.Statter, stdoutLogLevel int) (*AuditLogger, error)

NewAuditLogger returns a new AuditLogger that uses the given SyslogWriter as a backend.

func (*AuditLogger) Alert

func (log *AuditLogger) Alert(msg string) (err error)

Alert level messages pass through normally.

func (*AuditLogger) Audit

func (log *AuditLogger) Audit(msg string) (err error)

Audit sends a NOTICE-severity message that is prefixed with the audit tag, for special handling at the upstream system logger.

func (*AuditLogger) AuditErr

func (log *AuditLogger) AuditErr(msg error) (err error)

AuditErr can format an error for auditing; it does so at ERR level. AUDIT[ Error Conditions ] 9cc4d537-8534-4970-8665-4b382abe82f3

func (*AuditLogger) AuditObject

func (log *AuditLogger) AuditObject(msg string, obj interface{}) (err error)

AuditObject sends a NOTICE-severity JSON-serialized object message that is prefixed with the audit tag, for special handling at the upstream system logger.

func (*AuditLogger) AuditPanic

func (log *AuditLogger) AuditPanic()

AuditPanic catches panicking executables. This method should be added in a defer statement as early as possible AUDIT[ Error Conditions ] 9cc4d537-8534-4970-8665-4b382abe82f3

func (*AuditLogger) Crit

func (log *AuditLogger) Crit(msg string) (err error)

Crit level messages are automatically marked for audit

func (*AuditLogger) Debug

func (log *AuditLogger) Debug(msg string) (err error)

Debug level messages pass through normally.

func (*AuditLogger) Emerg

func (log *AuditLogger) Emerg(msg string) (err error)

Emerg level messages are automatically marked for audit

func (*AuditLogger) EmergencyExit

func (log *AuditLogger) EmergencyExit(msg string)

EmergencyExit triggers an immediate Boulder shutdown in the event of serious errors. This function will provide the necessary housekeeping. Currently, make an emergency log entry and exit; the Activity Monitor should notice the Emerg level event and shut down all components. AUDIT[ Error Conditions ] 9cc4d537-8534-4970-8665-4b382abe82f3

func (*AuditLogger) Err

func (log *AuditLogger) Err(msg string) (err error)

Err level messages are automatically marked for audit

func (*AuditLogger) Info

func (log *AuditLogger) Info(msg string) (err error)

Info level messages pass through normally.

func (*AuditLogger) InfoObject

func (log *AuditLogger) InfoObject(msg string, obj interface{}) (err error)

InfoObject sends an INFO-severity JSON-serialized object message.

func (*AuditLogger) Notice

func (log *AuditLogger) Notice(msg string) (err error)

Notice level messages pass through normally.

func (*AuditLogger) SetEmergencyExitFunc

func (log *AuditLogger) SetEmergencyExitFunc(exit exitFunction)

SetEmergencyExitFunc changes the systems' behavior on an emergency exit.

func (*AuditLogger) Warning

func (log *AuditLogger) Warning(msg string) (err error)

Warning level messages pass through normally.

func (*AuditLogger) WarningErr

func (log *AuditLogger) WarningErr(msg error) (err error)

WarningErr formats an error for the Warn level.

type SyslogWriter

type SyslogWriter interface {
	Close() error
	Alert(m string) error
	Crit(m string) error
	Debug(m string) error
	Emerg(m string) error
	Err(m string) error
	Info(m string) error
	Notice(m string) error
	Warning(m string) error
}

A SyslogWriter logs messages with explicit priority levels. It is implemented by a logging back-end like syslog.Writer or mocks.SyslogWriter.

Jump to

Keyboard shortcuts

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