Skip to content

wangxianzhuo/logrus-conf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logrus conf

Dependency

dep ensure

Usage

package main

import (
	"flag"
    log "github.com/sirupsen/logrus"
    "github.com/wangxianzhuo/logrus-conf"
)

func main() {
    flag.Parse()
    // auto configure logrus and it's file system hook
    logconf.Configure()

    // print log configs to stdout
    logconf.Configurations()

    // start a log conf admin server
    s := logconf.Server(1)
    s.Start(":9090")

    log.Infof("log file path: %s, line break: %s, segment interval: %d, file name pattern: %s, level: %s", *logconf.FilePath, *logconf.LineBreak, *logconf.SegmentInterval, *logconf.FileNamePattern, *logconf.Level)
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages