Merge pull request #200 from freeformz/no_msg
Don't emit a msg if there is none to emit
diff --git a/README.md b/README.md
index 6fa6e20..a0c0644 100644
--- a/README.md
+++ b/README.md
@@ -198,7 +198,7 @@
}
}
```
-
+Note: Syslog hook also support connecting to local syslog (Ex. "/dev/log" or "/var/run/syslog" or "/var/run/log"). For the detail, please check the [syslog hook README](hooks/syslog/README.md).
| Hook | Description |
| ----- | ----------- |
@@ -296,10 +296,10 @@
field to `true`. To force no colored output even if there is a TTY set the
`DisableColors` field to `true`
* `logrus.JSONFormatter`. Logs fields as JSON.
-* `logrus_logstash.LogstashFormatter`. Logs fields as Logstash Events (http://logstash.net).
+* `logrus/formatters/logstash.LogstashFormatter`. Logs fields as [Logstash](http://logstash.net) Events.
```go
- logrus.SetFormatter(&logrus_logstash.LogstashFormatter{Type: “application_name"})
+ logrus.SetFormatter(&logstash.LogstashFormatter{Type: “application_name"})
```
Third party logging formatters:
diff --git a/hooks/syslog/README.md b/hooks/syslog/README.md
index 4dbb8e7..066704b 100644
--- a/hooks/syslog/README.md
+++ b/hooks/syslog/README.md
@@ -18,3 +18,22 @@
}
}
```
+
+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)
+ }
+}
+```
\ No newline at end of file