mozilla-services/go-mozlogrus

Name: go-mozlogrus

Owner: Mozilla Services

Description: A logging library which conforms to Mozilla's logging standard for logrus users.

Created: 2016-06-10 16:22:49.0

Updated: 2017-11-14 15:00:00.0

Pushed: 2018-05-02 20:41:36.0

Homepage: null

Size: 19

Language: Go

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

mozlogrus GoDoc

A logging library which conforms to Mozilla's logging standard for logrus.

Installation

go get go.mozilla.org/mozlogrus

Example
Basic Usage
age main

rt (
log "github.com/Sirupsen/logrus"
"go.mozilla.org/mozlogrus"


 init() {
mozlogrus.Enable("ApplicationName")


 main() {
log.WithFields(log.Fields{
    "animal": "walrus",
    "size":   10,
}).Info("A group of walrus emerges from the ocean")

son
 run mozlogrus.go | jq

imestamp": 1487349663973687600,
ime": "2017-02-17T16:41:03Z",
ype": "app.log",
ogger": "ApplicationName",
ostname": "gator3",
nvVersion": "2.0",
id": 18061,
everity": 4,
ields": {
"animal": "walrus",
"msg": "A group of walrus emerges from the ocean",
"size": 10


Custom Log Types
 init() {
mozlogrus.EnableFormatter(&mozlogrus.MozLogFormatter{
    LoggerName: "ApplicationName",
    Type: "udp datagram",
})


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.