syslog reconfiguration
This commit is contained in:
parent
e2d92daf31
commit
e5bcea3ec3
@ -25,7 +25,7 @@ func init() {
|
||||
config.SetDefault(k, v)
|
||||
}
|
||||
Connected = false
|
||||
events.AddListener("config_changed", Reconfigure)
|
||||
events.AddListener("syslog_config_changed", Reconfigure)
|
||||
go Connect()
|
||||
}
|
||||
|
||||
@ -56,6 +56,7 @@ func Connect() {
|
||||
Err(fmt.Sprintf("failed to connect to syslog: %s", err.Error()))
|
||||
time.Sleep(1 * time.Second)
|
||||
go Connect()
|
||||
return
|
||||
}
|
||||
|
||||
switch format {
|
||||
|
@ -4,6 +4,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"git.openpdu.org/OpenPDU/openpdu/config"
|
||||
"git.openpdu.org/OpenPDU/openpdu/events"
|
||||
"git.openpdu.org/OpenPDU/openpdu/syslog"
|
||||
"gopkg.in/macaron.v1"
|
||||
)
|
||||
@ -39,5 +40,7 @@ func syslogPost(ctx *macaron.Context, f SyslogPostForm) {
|
||||
config.Set("Syslog.Format", strings.TrimSpace(f.Format))
|
||||
config.WriteConfig()
|
||||
|
||||
events.FireEvent("syslog_config_changed")
|
||||
|
||||
syslogPage(ctx)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user