Merge remote-tracking branch 'blallo/master'
This commit is contained in:
commit
3bf88506be
1 changed files with 6 additions and 5 deletions
11
main.go
11
main.go
|
@ -38,6 +38,8 @@ func main() {
|
|||
syslogSocketPath := flag.String("syslogd-socket", "", "The socket to listen to syslog addresses")
|
||||
// dumpSocketPath := flag.String("dump-socket", "/run/buffer.sock", "The socket that user will connect to in order to receive logs")
|
||||
bufsize := flag.Int("buffer-size", 1000, "Number of messages to keep")
|
||||
syslogAddr := flag.String("syslog-addr", "127.0.0.1:9514", "Address:port where to listen for syslog messages")
|
||||
queryAddr := flag.String("query-addr", "127.0.0.1:9080", "Address:port where to bind the query service")
|
||||
flag.Parse()
|
||||
|
||||
channel := make(chan format.LogParts)
|
||||
|
@ -50,17 +52,16 @@ func main() {
|
|||
server.ListenUnixgram(*syslogSocketPath)
|
||||
fmt.Printf("Binding socket `%s` [syslog]\n", *syslogSocketPath)
|
||||
} else {
|
||||
addr := "127.0.0.1:9514"
|
||||
fmt.Printf("Binding address `%s` [syslog]\n", addr)
|
||||
server.ListenUDP(addr)
|
||||
fmt.Printf("Binding address `%s` [syslog]\n", *syslogAddr)
|
||||
server.ListenUDP(*syslogAddr)
|
||||
}
|
||||
circbuf = ring.New(*bufsize)
|
||||
server.Boot()
|
||||
go syslogdHandler(channel)
|
||||
|
||||
http.HandleFunc("/", httpHandler)
|
||||
fmt.Printf("Binding address `%s` [http]\n", ":9080")
|
||||
http.ListenAndServe(":9080", nil)
|
||||
fmt.Printf("Binding address `%s` [http]\n", *queryAddr)
|
||||
http.ListenAndServe(*queryAddr, nil)
|
||||
|
||||
server.Wait()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue