Skip to content

Latest commit

 

History

History
51 lines (38 loc) · 873 Bytes

README.md

File metadata and controls

51 lines (38 loc) · 873 Bytes

Build Status

graylog-golang

graylog-golang is a full implementation for sending messages in GELF (Graylog Extended Log Format) from Go (Golang) to Graylog

Example

package main

import (
  "github.com/robertkowalski/graylog-golang"
)

func main() {

  g := gelf.New(gelf.Config{})

  g.Log(`{
      "version": "1.0",
      "host": "localhost",
      "timestamp": 1356262644,
      "facility": "Google Go",
      "short_message": "Hello From Golang!"
  }`)
}

Setting Config Values

g := gelf.New(gelf.Config{
  GraylogPort:     80,
  GraylogHostname: "example.com",
  Connection:      "wan",
  MaxChunkSizeWan: 42,
  MaxChunkSizeLan: 1337,
})

Tests

go test

Benchmarks

go test --bench=".*"