Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( FilePath = flag.String("log-path", "./logs/", "logrus will store to this path") LineBreak = flag.String("line-break", "\n", "line break") SegmentInterval = flag.Int64("segment-interval", 86400, "file segment interval") FileNamePattern = flag.String("file-name-pattern", "%YY-%MM-%DD_%HH-%mm-%SS.log", "log file name pattern") Level = flag.String("level", "info", "log level, can be: info, warn, debug, error, fatal, panic") Debug = flag.Bool("debug", false, "debug mode") KafkaTopic = flag.String("log-kafka-topic", "log_msg", "kafka topic for log") KafkaBrokers = flag.String("log-kafka-brokers", "localhost:9092", "kafka brokers for log, it can be like '192.168.1.100:9092,192.168.1.101:9092'") ToFileSystem = flag.Bool("to-file-sys", false, "switch of sending log to local file system") ToKafka = flag.Bool("to-kafka", false, "switch of sending log to kafka") )
Functions ¶
func Configurations ¶ added in v0.0.2
func Configurations()
Configurations print logrus configs to stdout
func ConfigureKafkaHook ¶ added in v0.0.5
func ConfigureKafkaHook()
ConfigureKafkaHook config kafka hook for logrus
func ConfigureLocalFileHook ¶ added in v0.0.5
func ConfigureLocalFileHook()
ConfigureLocalFileHook config local file system hook for logrus
func CustomFormatConifgure ¶
CustomFormatConifgure ...
func PrintConfigs ¶ added in v0.0.2
PrintConfigs print logrus config to io.writer
Types ¶
Click to show internal directories.
Click to hide internal directories.