Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/meinside/loggly-go
A Go library for Loggly
https://github.com/meinside/loggly-go
golang loggly
Last synced: about 2 months ago
JSON representation
A Go library for Loggly
- Host: GitHub
- URL: https://github.com/meinside/loggly-go
- Owner: meinside
- Created: 2017-05-10T03:15:25.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-03-04T01:07:10.000Z (almost 6 years ago)
- Last Synced: 2023-08-09T14:24:57.148Z (over 1 year ago)
- Topics: golang, loggly
- Language: Go
- Size: 11.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# loggly-go
A Go library for [Loggly](https://www.loggly.com/).
## How to get it
```bash
$ go get github.com/meinside/loggly-go
```## How to use it
```go
// sample.go
package mainimport (
"time""github.com/meinside/loggly-go"
)func main() {
logger := loggly.New("XXXXXX-0000-YYYY-ZZZZ-0000000000000")time.Sleep(1 * time.Second) // wait for the logger getting ready
// can log any type of variable
logger.Log("Hello loggly.") // a string,
for i := 0; i < 42; i++ {
logger.Log(i) // a number,
}
logger.Log(struct {
Severity string `json:"severity"`
Message string `json:"message"`
}{
Severity: "WARN",
Message: "This is a warning.",
}) // or even a struct// XXX - wait until all logs are transfered
time.Sleep(40 * time.Second)
}
```## License
MIT