Skip to content
This repository has been archived by the owner on Nov 4, 2020. It is now read-only.
forked from crewjam/rfc5424

a Go library that can read and write RFC-5424 syslog messages

License

Notifications You must be signed in to change notification settings

cloudfoundry-incubator/rfc5424

 
 

Repository files navigation

NOTE: This repository is deprecated in favor of go-loggregator

Build Status

This is a Go library that can read and write RFC-5424 syslog messages:

Example usage:

m := rfc5424.Message{
    Priority:  rfc5424.Daemon | rfc5424.Info,
    Timestamp: time.Now(),
    Hostname:  "myhostname",
    AppName:   "someapp",
    Message:   []byte("Hello, World!"),
}
m.AddDatum("foo@1234", "Revision", "1.2.3.4")
m.WriteTo(os.Stdout)

Produces output like:

107 <7>1 2016-02-28T09:57:10.804642398-05:00 myhostname someapp - - [foo@1234 Revision="1.2.3.4"] Hello, World!

You can also use the library to parse syslog messages:

m := rfc5424.Message{}
_, err := m.ReadFrom(os.Stdin)
fmt.Printf("%s\n", m.Message)

About

a Go library that can read and write RFC-5424 syslog messages

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • Go 100.0%