zoggly

package module
v0.0.0-...-aa0341a Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2019 License: MIT Imports: 3 Imported by: 0

README

zoggly (ARCHIVED)

Loggly hooks for GO uber ⚡ Zap logger

Archived

This is probably so out of sync with the main package there's no reason to have it now.

Usage

This example sends to loggly and standard out.

package main

import (
    "github.com/peppage/zoggly"
    "github.com/uber-go/zap"
)

var logglyToken string = "token from source setup"
var logger zap.Logger

func main() {
    zl := NewZapLoggly(logglyToken)
	logger = zap.New(zap.NewJSONEncoder(), zap.ErrorLevel,
		zap.Output(zap.Tee(os.Stdout, zl.GetWriter())))

    // Make sure to flush to send all logs before exiting
    defer zl.Flush()
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ZapLoggly

type ZapLoggly struct {
	io.Writer
	// contains filtered or unexported fields
}

func NewZoggly

func NewZoggly(token string, tags ...string) *ZapLoggly

func (*ZapLoggly) Flush

func (z *ZapLoggly) Flush()

func (*ZapLoggly) GetWriter

func (z *ZapLoggly) GetWriter() zap.WriteSyncer

func (*ZapLoggly) Write

func (z *ZapLoggly) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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