An open API service indexing awesome lists of open source software.

https://github.com/gjbae1212/go-relogger

It is a logger that supports to reopen logging file when traps signal or is passed a time interval.
https://github.com/gjbae1212/go-relogger

go golang logger refresh reopen

Last synced: about 1 year ago
JSON representation

It is a logger that supports to reopen logging file when traps signal or is passed a time interval.

Awesome Lists containing this project

README

          

# go-relogger



Go Report Card

license

## Overview
**go-relogger** is a logger that supports to reopen logging file when traps signal or is passed a time interval.
It can use to the logrotate(current logging file moves to an other logging file with suffix).
> Because a logger prints previous logging file until logger reopens.

## Getting Started
```go
package main
import (
"os"
"time"
"github.com/gjbae1212/go-relogger"
)

func main() {
logger, err := NewReLogger("your-log-path", relogger.WithSignals([]os.Signal{
syscall.SIGHUP}),
relogger.WithRefreshDuration(time.Hour))
}
```

## LICENSE
This project is following The MIT.