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