Skip to content
clawioPublic

About

grpcxlog implements an adapter to use xlog as the logger for grpclog

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

grpcxlog

grpcxlog implements an adapter to use xlog as the logger for grpc

gRPC applications use glog as the defautl logger.

xlog is a powerfull logger for HTTP based applications.

grpcxlog is and apdater to use xlog in gRPC based applications to have the same log format independently of the protocol used.

Usage

host, _ := os.Hostname()
conf := xlog.Config{
	// Log debug level and higher
	Level: xlog.LevelDebug,
	// Set some global env fields
	Fields: xlog.F{
		"svc":  "my-service",
		"host": host,
	},
	// Output everything on console
	Output: xlog.NewOutputChannel(xlog.NewConsoleOutput()),
}

log = xlog.New(conf)

// Plug the xlog logger to gRPC logger
grpclog.SetLogger(grpcxlog.Log{log})

About

grpcxlog implements an adapter to use xlog as the logger for grpclog

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages