mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
Update service and syslog code to use variable instead of constant
for the process name and service name. This allows the reuse of this code in NATS Streaming Server by invoking the new setters to change the service and process names. Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
This commit is contained in:
@@ -31,6 +31,10 @@ type SysLogger struct {
|
||||
trace bool
|
||||
}
|
||||
|
||||
// SetSyslogName sets the name to use for the syslog.
|
||||
// Currently used only on Windows.
|
||||
func SetSyslogName(name string) {}
|
||||
|
||||
// GetSysLoggerTag generates the tag name for use in syslog statements. If
|
||||
// the executable is linked, the name of the link will be used as the tag,
|
||||
// otherwise, the name of the executable is used. "gnatsd" is the default
|
||||
|
||||
@@ -22,9 +22,12 @@ import (
|
||||
"golang.org/x/sys/windows/svc/eventlog"
|
||||
)
|
||||
|
||||
const (
|
||||
natsEventSource = "NATS-Server"
|
||||
)
|
||||
var natsEventSource = "NATS-Server"
|
||||
|
||||
// SetSyslogName sets the name to use for the system log event source
|
||||
func SetSyslogName(name string) {
|
||||
natsEventSource = name
|
||||
}
|
||||
|
||||
// SysLogger logs to the windows event logger
|
||||
type SysLogger struct {
|
||||
|
||||
Reference in New Issue
Block a user