distlog

command module
v0.0.0-...-a029e80 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 27, 2017 License: MIT Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

distlog

Example of distributed logging with gRPC and Zap based on net/context. It shows the possibility to pass context variables between the distributed services.

Run

Run http server
go run server.go

Sample logs from http server:

md@md distlog (master)$ go run server.go
{"level":"info","time":"2017-01-27T19:23:54Z","reqId":"7febbbcd-8bd1-4e9e-b6cb-6ff4aa55bf34","msg":"got arguments from http request","pid":23003,"exe":"server","arg1":1,"arg2":2,"operation":"ADD"}
{"level":"info","time":"2017-01-27T19:23:54Z","reqId":"7febbbcd-8bd1-4e9e-b6cb-6ff4aa55bf34","msg":"got result for arguments","pid":23003,"exe":"server","arg1":1,"arg2":2,"operation":"ADD","result":3
Run gRPC server
go run calculator.go

Sample logs from gRPC server:

md@md distlog (master *#)$ go run calculator.go
{"level":"info","time":"2017-01-27T19:23:54Z","reqId":"7febbbcd-8bd1-4e9e-b6cb-6ff4aa55bf34","msg":"got arguments from rpc request","pid":22970,"exe":"calculator","arg1":1,"arg2":2,"operation":"ADD"}

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package service is a generated protocol buffer package.
Package service is a generated protocol buffer package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址