Skip to content

rhettg/ot-logfmt-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenTracing Logging Implementation

OpenTracing compatible logging implementation.

Use the same standard opentracing interface for your structured application logging!

[WORK IN PROGRESS] This project is just getting started and is not yet functional

Usage

Configure ot-logfmt as your tracer:

opentracing.InitGlobalTracer(
        // tracing impl specific:
        ot_logfmt.NewTracer()
    )

Trace and log against the tracer interface:

span := opentracing.StartSpan("request")
span.SetTag("http.method", "GET")

span.LogFields(log.String("event", "finish"), log.String("message", "We have done a request"))

This will have outputted to stdout:

ts=1509745762970 event=finish message="We have done a request" http.method=GET operation=request

About

Opentracing implementation to output in logfmt

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages