Documentation
¶
Index ¶
Constants ¶
View Source
const ( // DefaultLogMaxSizeMB - rotate a log file once it reaches this size (MB) DefaultLogMaxSizeMB = 50 // DefaultLogMaxBackups - max number of rotated files to retain per log DefaultLogMaxBackups = 20 // DefaultLogMaxAgeDays - delete rotated files older than this many days DefaultLogMaxAgeDays = 90 )
Log rotation defaults — bound disk usage so a runaway error loop can't grow a log file without limit (the sinks were previously plain os.OpenFile appends).
Variables ¶
View Source
var ( // RootLoggerName - Root logger name, contains all log data RootLoggerName = "root" // RootLogger - Root Logger RootLogger = rootLogger() )
View Source
var (
// AuditLogger - Single audit log
AuditLogger = newAuditLogger()
)
Functions ¶
func GetRootAppDir ¶
func GetRootAppDir() string
GetRootAppDir - Get the Sliver app dir, default is: ~/.sliver/
func NamedLogger ¶
NamedLogger - Returns a logger wrapped with pkg/stream fields
func SetRotationConfig ¶ added in v1.7.6
SetRotationConfig retunes the rotating log writers from server config. Values <= 0 (or a nil compress) keep the current/built-in default. Intended to be called once, after the server config has loaded.
Types ¶
type StdoutHook ¶ added in v1.5.30
type StdoutHook struct {
Name string
// contains filtered or unexported fields
}
TxtHook - Hook in a textual version of the logs
func NewStdoutHook ¶ added in v1.5.30
func NewStdoutHook(name string) *StdoutHook
NewTxtHook - returns a new txt hook
func (*StdoutHook) Fire ¶ added in v1.5.30
func (hook *StdoutHook) Fire(entry *logrus.Entry) error
Fire - Implements the fire method of the Logrus hook
func (*StdoutHook) Levels ¶ added in v1.5.30
func (hook *StdoutHook) Levels() []logrus.Level
Levels - Hook all levels
Click to show internal directories.
Click to hide internal directories.