Skip to content

Latest commit

 

History

History
32 lines (27 loc) · 1.29 KB

README.md

File metadata and controls

32 lines (27 loc) · 1.29 KB

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

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.