Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileWriter ¶
type FileWriter struct { sync.RWMutex // write log order by order and atomic incr maxLinesCurLines and maxSizeCurSize // The opened file Filename string `json:"filename"` // Rotate at line MaxLines int `json:"maxlines"` // Rotate at size MaxSize int `json:"maxsize"` // Rotate daily Daily bool `json:"daily"` MaxDays int64 `json:"maxdays"` Rotate bool `json:"rotate"` Perm string `json:"perm"` RotatePerm string `json:"rotateperm"` // contains filtered or unexported fields }
FileWriter implements io.Writer interface It writes messages by lines limit, file size limit, or time frequency.
func (*FileWriter) Destroy ¶
func (w *FileWriter) Destroy()
Destroy close the file description, close file writer.
func (*FileWriter) Flush ¶
func (w *FileWriter) Flush()
Flush flush file logger. there are no buffering messages in file logger in memory. flush file means sync file from disk.
func (*FileWriter) Init ¶
func (w *FileWriter) Init(jsonConfig string) error
Init file logger with json config. jsonConfig like:
{ "filename":"logs/beego.log", "maxLines":10000, "maxsize":1024, "daily":true, "maxDays":15, "rotate":true, "perm":"0600" }
Click to show internal directories.
Click to hide internal directories.