filelog

package
v1.0.25 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileWriter

type FileWriter struct {
	log.LogFilter
	log.LogFormatter

	Path      string    // Log file path name
	DirPerm   uint32    // Log dir permission
	FilePerm  uint32    // Log file permission
	MaxSplit  int       // Max split files
	MaxSize   int64     // Rotate at size
	MaxDays   int       // Max daily files
	MaxHours  int       // Max hourly files
	Gzip      bool      // Compress rotated log files
	SyncLevel log.Level // Call File.Sync() if level <= SyncLevel
	// contains filtered or unexported fields
}

FileWriter implements Writer. It writes messages and rotate by file size limit, daily, hourly.

func (*FileWriter) Close

func (fw *FileWriter) Close()

Close close the file description, close file writer.

func (*FileWriter) Flush

func (fw *FileWriter) Flush()

Flush flush file logger. there are no buffering messages in file logger in memory. flush file means sync file to disk.

func (*FileWriter) SetMaxSize

func (fw *FileWriter) SetMaxSize(maxSize string)

SetMaxSize set the MaxSize

func (*FileWriter) SetSyncLevel

func (fw *FileWriter) SetSyncLevel(lvl string)

SetSyncLevel set the sync level

func (*FileWriter) Write

func (fw *FileWriter) Write(le *log.Event) error

Write write logger message into file.

Jump to

Keyboard shortcuts

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