fluent

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2013 License: MIT Imports: 5 Imported by: 0

README

fluent-logger-golang

Build Status

A structured event logger for Fluentd (Golang)

How to install

go get github.com/t-k/fluent-logger-golang

Usage

Install the package with go get and use import to include it in your project.

import "github.com/t-k/fluent-logger-golang"

GoDoc: http://godoc.org/github.com/t-k/fluent-logger-golang

##Example

package main

import (
  "github.com/t-k/fluent-logger-golang"
  "fmt"
)

func main() {
  logger := fluent.New(fluent.Config{})
  err := logger.Connect()
  if err != nil {
    fmt.Println(err)
  }
  defer logger.Close()
  tag := "myapp.access"
  message := "testing"
  logger.Post(tag, message)
}

Setting Config Values

f := fluent.New(fluent.Config{FluentPort: 80, FluentHost: "example.com"})

Tests

go test

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	FluentPort int
	FluentHost string
}

type Fluent

type Fluent struct {
	Config
	// contains filtered or unexported fields
}

func New

func New(config Config) (f *Fluent)

func (*Fluent) Close

func (f *Fluent) Close() (err error)

func (*Fluent) Connect

func (f *Fluent) Connect() (err error)

func (*Fluent) Post

func (f *Fluent) Post(tag, message string)

func (*Fluent) Send

func (f *Fluent) Send(data []byte) (err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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