Documentation ¶
Overview ¶
zaproll provides a rolling logger for nanozap.
zaproll use buffer writer to improve I/O throughput, and there is only one goroutine could write, so Mutex is light.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backup ¶
type Backup struct {
// contains filtered or unexported fields
}
Backup holds backup log file' path & create time.
type Backups ¶
type Backups struct {
// contains filtered or unexported fields
}
Backups implements heap interface.
type Config ¶
type Config struct { // OutputPath is the log file path. OutputPath string `json:"output_path" toml:"output_path"` // MaxSize is the maximum size of a log file before it gets rotated. // Unit: MB. // Default: 128 (128MB). MaxSize int64 `json:"max_size_mb" toml:"max_size_mb"` // MaxBackups is the maximum number of backup log files to retain. MaxBackups int `json:"max_backups" toml:"max_backups"` // LocalTime is the timestamp in backup log file. Default is to use UTC time. // If true, use local time. LocalTime bool `json:"local_time" toml:"local_time"` // PerWriteSize is zaproll's write size, // zaproll writes data to page cache every PerWriteSize. // Unit: KB. // Default: 64 (64KB). // // It's used for combining writes. // The size of it should be aligned to page size, // and it shouldn't be too large, because that may block zaproll write. PerWriteSize int64 `json:"per_write_size" toml:"per_write_size"` // PerSyncSize is zaproll's sync size, // zaproll flushes data to storage media(hint) every PerSyncSize. // Unit: MB. // Default: 16 (16MB). // // The size of it should be aligned to page size, // and it shouldn't be too large, avoiding burst I/O. PerSyncSize int64 `json:"per_sync_size" toml:"per_sync_size"` // Develop mode. Default is false. // It' used for testing, if it's true, the page cache control unit could not be aligned to page cache size. Developed bool `json:"developed" toml:"developed"` }
Config of zaproll.
Click to show internal directories.
Click to hide internal directories.