Sends logs to logz.io over HTTP
$ go get -u github.com/dougEfresh/logzio-go
package main
import (
"fmt"
"github.com/dougEfresh/logzio-go"
"os"
"time"
)
func main() {
l, err := logzio.New(os.Args[1]) // Token is required
if err != nil {
panic(err)
}
msg := fmt.Sprintf("{ \"%s\": \"%s\"}", "message", time.Now().UnixNano())
err = l.Send([]byte(msg))
if err != nil {
panic(err)
}
l.Stop() //logs are buffered on disk. Stop will drain the buffer
}
logzio sender is a low level lib meant to be integrated with other logging libs
Setting drain duration (flush logs on disk) : logzio.New(token, SetDrainDuration(time.Hour))
Setting url mode: logzio.New(token, SetUrl(ts.URL))
Setting debug mode: logzio.New(token, SetDebug(os.Stderr))
Setting queue dir: logzio.New(token, SetSetTempDirectory(os.Stderr))
Logzio go client uses goleveldb and goqueue as a persistent storage. Every 5 seconds logs are sent to logz.io (if any are available)
Uber Zap: zapz
GO kit: kitz
go 1.x
$ go test -v
See travis.yaml for running benchmark tests
All PRs are welcome
- Douglas Chimento - dougEfresh
- Ido Halevi - idohalevi
This project is licensed under the Apache License - see the LICENSE file for details