Documentation ¶
Overview ¶
Package logger provides logging facilities for the NATS server
Index ¶
- func GetSysLoggerTag() string
- func SetSyslogName(name string)
- type Logger
- func (l *Logger) Close() error
- func (l *Logger) Debugf(format string, v ...interface{})
- func (l *Logger) Errorf(format string, v ...interface{})
- func (l *Logger) Fatalf(format string, v ...interface{})
- func (l *Logger) Noticef(format string, v ...interface{})
- func (l *Logger) SetSizeLimit(limit int64) error
- func (l *Logger) Tracef(format string, v ...interface{})
- func (l *Logger) Warnf(format string, v ...interface{})
- type SysLogger
- func (l *SysLogger) Debugf(format string, v ...interface{})
- func (l *SysLogger) Errorf(format string, v ...interface{})
- func (l *SysLogger) Fatalf(format string, v ...interface{})
- func (l *SysLogger) Noticef(format string, v ...interface{})
- func (l *SysLogger) Tracef(format string, v ...interface{})
- func (l *SysLogger) Warnf(format string, v ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSysLoggerTag ¶
func GetSysLoggerTag() 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. "nats-server" is the default for the NATS server.
func SetSyslogName ¶
func SetSyslogName(name string)
SetSyslogName sets the name to use for the syslog. Currently used only on Windows.
Types ¶
type Logger ¶
Logger is the server logger
func NewFileLogger ¶
NewFileLogger creates a logger with output directed to a file
func NewStdLogger ¶
NewStdLogger creates a logger with output directed to Stderr
func NewTestLogger ¶
NewTestLogger creates a logger with output directed to Stderr with a prefix. Useful for tracing in tests when multiple servers are in the same pid
func (*Logger) Close ¶
Close implements the io.Closer interface to clean up resources in the server's logger implementation. Caller must ensure threadsafety.
func (*Logger) SetSizeLimit ¶
SetSizeLimit sets the size of a logfile after which a backup is created with the file name + "year.month.day.hour.min.sec.nanosec" and the current log is truncated.
type SysLogger ¶
type SysLogger struct {
// contains filtered or unexported fields
}
SysLogger provides a system logger facility
func NewRemoteSysLogger ¶
NewRemoteSysLogger creates a new remote system logger
func NewSysLogger ¶
NewSysLogger creates a new system logger