diff options
author | Lukas Macko <lmacko@cisco.com> | 2017-09-12 09:54:58 +0200 |
---|---|---|
committer | Lukas Macko <lmacko@cisco.com> | 2017-09-12 10:49:11 +0200 |
commit | 217383b613248c79b542623ec6c571591de113ce (patch) | |
tree | 35b2064a8b780e0b18a8ffba31757caa2ed3e10f /vendor/github.com/Sirupsen/logrus/hooks/syslog/README.md | |
parent | d07761baec9f09aef0b140ea46e38bd597dbdbbc (diff) |
Use Sirupsen/logrus with uppercase
Change-Id: I2f8870c52f64eb56deb44e4a807867b3ef0a0b76
Signed-off-by: Lukas Macko <lmacko@cisco.com>
Diffstat (limited to 'vendor/github.com/Sirupsen/logrus/hooks/syslog/README.md')
-rw-r--r-- | vendor/github.com/Sirupsen/logrus/hooks/syslog/README.md | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/vendor/github.com/Sirupsen/logrus/hooks/syslog/README.md b/vendor/github.com/Sirupsen/logrus/hooks/syslog/README.md new file mode 100644 index 0000000..92b391c --- /dev/null +++ b/vendor/github.com/Sirupsen/logrus/hooks/syslog/README.md @@ -0,0 +1,39 @@ +# Syslog Hooks for Logrus <img src="http://i.imgur.com/hTeVwmJ.png" width="40" height="40" alt=":walrus:" class="emoji" title=":walrus:"/> + +## Usage + +```go +import ( + "log/syslog" + "github.com/sirupsen/logrus" + logrus_syslog "github.com/sirupsen/logrus/hooks/syslog" +) + +func main() { + log := logrus.New() + hook, err := logrus_syslog.NewSyslogHook("udp", "localhost:514", syslog.LOG_INFO, "") + + if err == nil { + log.Hooks.Add(hook) + } +} +``` + +If you want to connect to local syslog (Ex. "/dev/log" or "/var/run/syslog" or "/var/run/log"). Just assign empty string to the first two parameters of `NewSyslogHook`. It should look like the following. + +```go +import ( + "log/syslog" + "github.com/sirupsen/logrus" + logrus_syslog "github.com/sirupsen/logrus/hooks/syslog" +) + +func main() { + log := logrus.New() + hook, err := logrus_syslog.NewSyslogHook("", "", syslog.LOG_INFO, "") + + if err == nil { + log.Hooks.Add(hook) + } +} +``` |