diff options
author | Ondrej Fabry <ofabry@cisco.com> | 2017-11-28 16:28:48 +0100 |
---|---|---|
committer | Ondrej Fabry <ofabry@cisco.com> | 2017-11-28 16:29:42 +0100 |
commit | ac6019137d5b10d02c7acac4f63fa22091b9933d (patch) | |
tree | 6b7cc4ecd56fce967bf5665292503459582a58ac /vendor/github.com/sirupsen/logrus/hooks/syslog/README.md | |
parent | 3f1edad4e6ba0a7876750aea55507fae14d8badf (diff) |
Fix imports for github.com/sirupsen/logrus
Change-Id: I84f2e45e5ff188a2a7a80cf69f607b44486c1754
Signed-off-by: Ondrej Fabry <ofabry@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) + } +} +``` |