https://github.com/mailsac/saclogsend
A wrapper for logging to a remote syslog server over UDP
https://github.com/mailsac/saclogsend
Last synced: 5 months ago
JSON representation
A wrapper for logging to a remote syslog server over UDP
- Host: GitHub
- URL: https://github.com/mailsac/saclogsend
- Owner: mailsac
- License: mit
- Created: 2017-12-05T00:41:13.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-31T14:00:53.000Z (about 8 years ago)
- Last Synced: 2024-06-20T10:16:42.931Z (almost 2 years ago)
- Language: Go
- Homepage: https://mailsac.com/docs/api
- Size: 3.91 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# saclogsend
A wrapper around Go's syslog package for transmitting logs to a remote syslog server over UDP.
Used by the Go microservices of [mailsac.com](https://mailsac.com/docs/api).
## Usage
```go
package main
import (
"flag"
"github.com/mailsac/saclogsend"
)
var syslogNet = flag.String("syslog", "127.0.0.1:514", "net location of a syslog server")
var slog *saclogsend.Slog
func main() {
flag.Parse()
var err error
slog, err = saclogsend.New("inbound", *syslogNet)
if err != nil {
slog.Err("failed connecting to syslog, %s", err.Error())
} else {
slog.Info("syslog connected:" + *syslogNet)
}
}
```
## License
MIT