Skip to content
This repository has been archived by the owner on Feb 23, 2018. It is now read-only.

lestrrat-morgue/go-echo-apachelog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-echo-apachelog

Apache-style logger for echo

Usage

If you just want to see the access log in STDERR:

  e.Use(apachelog.Logger(os.Stderr))

If you want to rotate logs and such, you will need to replace the destination, so you should keep the ApacheLog struct:

  l := &ApacheLog{}
  l.LogFormat = logformat.CombinedLog.Clone()
  l.LogFormat.SetOutput(dst)

  e.Use(l.Wrap)

  // elsewhere in your code...
  l.LogFormat.SetOutput(newLogDestination)

Or you can use go-file-rotatelogs

  rl := rotatelogs.NewRotateLogs( ... )
  e.Use(apachelog.Logger(rl))

About

Apache-style logger for echo

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages