Skip to content

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

License

Notifications You must be signed in to change notification settings

gjbae1212/go-relogger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published