log

package
v0.0.0-...-b20fc4b Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2015 License: MPL-2.0 Imports: 10 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 {
	*syslog.Writer
	Stats statsd.Statter
	// contains filtered or unexported fields
}

AuditLogger is a System Logger with additional audit-specific methods. In addition to all the standard syslog.Writer methods from http://golang.org/pkg/log/syslog/#Writer, you can also call

auditLogger.Audit(msg string)

to send a message as an audit event.

func Dial

func Dial(network, raddr string, tag string, stats statsd.Statter) (*AuditLogger, error)

Dial establishes a connection to the log daemon by passing through the parameters to the syslog.Dial method. See http://golang.org/pkg/log/syslog/#Dial

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 subequent access to an already-set AuditLogger also cannot error, so this method is error-safe.

func NewAuditLogger

func NewAuditLogger(log *syslog.Writer, stats statsd.Statter) (*AuditLogger, error)

NewAuditLogger constructs an Audit Logger that decorates a normal System Logger. All methods in log/syslog continue to work.

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) 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.

Jump to

Keyboard shortcuts

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