Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/parkhub/go-loggly
Logger built in golang that ships logs to loggly either in bulk or one at a time.
https://github.com/parkhub/go-loggly
go golang-package logger loggly
Last synced: 29 days ago
JSON representation
Logger built in golang that ships logs to loggly either in bulk or one at a time.
- Host: GitHub
- URL: https://github.com/parkhub/go-loggly
- Owner: parkhub
- License: mit
- Created: 2019-12-13T21:30:59.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-12-05T01:57:15.000Z (about 3 years ago)
- Last Synced: 2024-06-20T09:15:10.399Z (7 months ago)
- Topics: go, golang-package, logger, loggly
- Language: Go
- Size: 6.84 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-loggly
This package provides the ability to use both bulk and single log endpoint to ship your logs to loggly. You must provide a token generated from loggly.
## Installing
### ([godoc](//godoc.org/github.com/parkhub/go-loggly))
go get github.com/parkhub/go-loggly
## Setting up your logger
```
package mainimport (
log "github.com/parkhub/go-loggly"
)func main() {
log.SetupLogger("yourlogglytoken", LogLevelInfo, []string{"test"}, false, true)// Print info statement
log.Infoln("This is an info statement.")// Print info statement with data
type testStruct struct {
Name string
Kind string
}test := &testStruct{
Name: "Logan",
Kind: "Log",
}log.Infod("This is some text", test)
// Print debug text
log.Debugln("This is a debug statement.")// Print debug text with additional data.
log.Debugf("This is a debug statement %d.", 10000)// Print info text
log.Infoln("This is an info statement.")// Print info text with additional data.
log.Infof("This is an info statement %d.", 10000)// Print warn text
log.Warnln("This is a warning.")// Print warn text with additional data.
log.Warnf("This is a warning %d.", 10000)// Print error text
log.Errorln("This is an error.")// Print error text with additional data.
log.Errorf("This is an error %d.", 10000)// Print fatal text
log.Fatalln("This is an error.")// Print fatal text with additional data.
log.Fatalf("This is an error %d.", 10000)
}
```