Skip to content

Repository files navigation

Log

GoDoc

Formatter for logrus, allowing log entries to be recognized by the fluentd Stackdriver agent on Google Cloud Platform.

Example:

package main
import (
"time""net/http"
log "github.com/sirupsen/logrus"
joonix "github.com/joonix/log"
)
funcmain() {
log.SetFormatter(joonix.NewFormatter())
log.Info("hello world!")
// log a HTTP request in your handlerlog.WithField("httpRequest", &joonix.HTTPRequest{
Request: r,
Status: http.StatusOK,
ResponseSize: 31337,
Latency: 123*time.Millisecond,
}).Info("additional info")
}

Alternatives

Kubernetes logging from outside of GCP

It is possible to run the google edition of fluentd a.k.a. stackdriver agent outside of GCP, just a bit tricky to configure. See following references for more info:

About

Logging utilities

Resources

Stars

51 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages