Documentation ¶
Overview ¶
This is a Scribe logging handler, that emits its messages to a scribe server
Index ¶
Constants ¶
const FORMAT_STRING = "[%s] [%s] [%s in %s:%d] %s"
format for the scribe formatter. we add the hostname so we can distinguish between messages from different servers
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ScribeFormatter ¶
type ScribeFormatter struct{}
func (*ScribeFormatter) Format ¶
func (f *ScribeFormatter) Format(ctx *logging.MessageContext, message string, args ...interface{}) string
type ScribeLogger ¶
type ScribeLogger struct {
// contains filtered or unexported fields
}
func NewScribeLogger ¶
func NewScribeLogger(addr string, category string, bufferSize int, secondaryOutput io.Writer) *ScribeLogger
Create and init a new scribe logger. This will not connect to the scribe server directly
addr is the scribe servers "host:port" string.
category - the scribe category prefix for all your messages. They wil be formatted as "category.LEVEL"
bufferSize is the sending channel's buffer size. 100 is a good estimate. This causes sends to be non blocking
func (*ScribeLogger) Emit ¶
func (l *ScribeLogger) Emit(ctx *logging.MessageContext, message string, args ...interface{}) error
Emit - format the message and queue it to be sent to the scribe server
func (*ScribeLogger) SetFormatter ¶
func (l *ScribeLogger) SetFormatter(f logging.Formatter)
func (*ScribeLogger) Stop ¶
func (l *ScribeLogger) Stop()
Stop the handler from sending to scribe, by setting the enabled flag. This will cause the send loop to exit