revfluent

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

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

Go to latest
Published: Oct 24, 2015 License: MIT Imports: 3 Imported by: 0

README

revfluentd Build Status

Fluentd logging for Revel framework.

Installation
    go get github.com/janekolszak/revfluent
Test
    fluentd -c fluent.conf &;
    revel test github.com/janekolszak/revfluent/testapp dev;
Initialization

In app.init() in app/init.go add:

    revel.OnAppStart(revfluent.Init)

This will initialize global revfluent.Logger.

Usage
    import  log "github.com/janekolszak/revfluent"

    data := map[string]string{"message": "Some message"}
    log.Error(data)
    log.Info(data)
    log.Debug(data)
    log.Log("Tag", data)
    log.Logger.Log("Tag", data)

You may define you own kinds of logs with revfluent.Log().

Configuration

In app.conf:

    revfluent.host = 127.0.0.1
    revfluent.port = 24224
    revfluent.network = tcp
    revfluent.socketPath =
    revfluent.bufferLimit = 8388608
    revfluent.retryWait = 500ms
    revfluent.maxRetry = 13
    revfluent.tagPrefix = RevFluentTest
    revfluent.timeout = 60s

Fields retryWait and timeout accept duration ("ms", "s", "m", "h").

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Logger *fluent.Fluent // Global logger
)

Functions

func Debug

func Debug(message interface{})

func Error

func Error(message interface{})

func Info

func Info(message interface{})

func Init

func Init()

Reads configuration and connects to fluentd

func Log

func Log(tag string, message interface{})

Types

This section is empty.

Directories

Path Synopsis
testapp
app

Jump to

Keyboard shortcuts

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