Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/m0zgen/rolog-example
Example for Rotation Log module
https://github.com/m0zgen/rolog-example
Last synced: 22 days ago
JSON representation
Example for Rotation Log module
- Host: GitHub
- URL: https://github.com/m0zgen/rolog-example
- Owner: m0zgen
- Created: 2024-07-27T08:09:08.000Z (6 months ago)
- Default Branch: master
- Last Pushed: 2024-07-28T13:59:08.000Z (6 months ago)
- Last Synced: 2025-01-06T00:13:56.467Z (29 days ago)
- Language: Go
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# RoLog Example
This is a demo app for usage Rotate Log module.
## Parameters
- `logDir` - Log store catalog
- `staticFilename` - Permanent log file name
- `archivePattern` - Backup log file name
- `zippedArchive` - Pack backup log to `zip` format
- `maxSize` - Max log file size in megabytes
- `maxAge` - Max log age in days
- `maxBackups` - Number of backup logs
- `checkInterval` - Check backup need in hours
- `bufferSize` - Size of the log message buffer
- `logLevel` - Set the log level to Info## Usage Example
```go
logDir := "logs"
staticFilename := "application.log" // Permanent log file name
archivePattern := "application-%s.log" // Backup log file name
zippedArchive := true // Archive log yes/no
maxSize := 1 // 20 MB
maxAge := 14 // 14 days
maxBackups := 3 // 3 backups
checkInterval := time.Hour // Check every hour
bufferSize := 100 // Size of the log message buffer
logLevel := logrus.InfoLevel // Set the log level to Info
```