Golang log/syslog.Writer.Alert() function example
package log/syslog
Golang log/syslog.Writer.Alert() function usage example
package main
import (
"log"
"log/syslog"
)
func main() {
logWriter, err := syslog.New(syslog.LOG_ERR, "Socketloop Error!")
defer logWriter.Close()
if err != nil {
log.Fatal("error")
}
logWriter.Alert("alert")
logWriter.Write([]byte("Hello Logger!"))
}
Reference :
Advertisement
Something interesting
Tutorials
+6.5k Golang : Map within a map example
+15.3k Golang : How to get Unix file descriptor for console and file
+16.8k Golang : Read integer from file into array
+6.1k Golang : Dealing with backquote
+4.4k Linux/MacOSX : Search and delete files by extension
+6.9k Golang : Normalize email to prevent multiple signups example
+9.7k Golang : Eroding and dilating image with OpenCV example
+12.7k Golang : Sort and reverse sort a slice of bytes
+24.6k Golang : How to print rune, unicode, utf-8 and non-ASCII CJK(Chinese/Japanese/Korean) characters?
+10.1k Golang : Identifying Golang HTTP client request
+5.6k PHP : Fix Call to undefined function curl_init() error