Documentation ¶
Overview ¶
Package lfshook is hook for sirupsen/logrus that used for writing the logs to local files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LfsHook ¶
type LfsHook struct {
// contains filtered or unexported fields
}
LfsHook is a hook to handle writing to local log files.
func NewHook ¶
NewHook returns new LFS hook. Output can be a string, io.Writer, WriterMap or PathMap. If using io.Writer or WriterMap, user is responsible for closing the used io.Writer.
func (*LfsHook) Fire ¶
Fire writes the log file to defined path or using the defined writer. User who run this function needs write permissions to the file or directory if the file does not yet exist.
func (*LfsHook) Levels ¶
Levels returns configured log levels.
func (*LfsHook) SetDefaultPath ¶
SetDefaultPath sets default path for levels that don't have any defined output path.
func (*LfsHook) SetDefaultWriter ¶
SetDefaultWriter sets default writer for levels that don't have any defined writer.
type PathMap ¶
PathMap is map for mapping a log level to a file's path. Multiple levels may share a file, but multiple files may not be used for one level.