Documentation
¶
Index ¶
- type ErrorHandler
- type Logger
- func (logger *Logger) Destroy()
- func (logger *Logger) LogDebug(now time.Time, msg string, isJSON bool)
- func (logger *Logger) LogError(now time.Time, msg string, isJSON bool)
- func (logger *Logger) LogInfo(now time.Time, msg string, isJSON bool)
- func (logger *Logger) LogWarning(now time.Time, msg string, isJSON bool)
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrorHandler ¶
type ErrorHandler func(message string)
ErrorHandler is a callback to call if an internal error must be notified.
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is the object that controls file logging.
type Options ¶
type Options struct { // Application name to use. Defaults to the binary name. AppName string `json:"appName,omitempty"` // Syslog server host name. Host string `json:"host,omitempty"` // Syslog server port. Defaults to 514, 1468 or 6514 depending on the network protocol used. Port uint16 `json:"port,omitempty"` // Use TCP instead of UDP. UseTcp bool `json:"useTcp,omitempty"` // Uses a secure connection. Implies TCP. UseTls bool `json:"useTls,omitempty"` // Send messages in the new RFC 5424 format instead of the original RFC 3164 specification. UseRFC5424 bool `json:"useRFC5424,omitempty"` // Set the maximum amount of messages to keep in memory if connection to the server is lost. MaxMessageQueueSize uint `json:"queueSize,omitempty"` // TLSConfig optionally provides a TLS configuration for use. TlsConfig *tls.Config // A callback to call if an internal error is encountered. ErrorHandler ErrorHandler }
Options specifies the sys logger settings to use when it is created.
Click to show internal directories.
Click to hide internal directories.