Documentation ¶
Overview ¶
logging is an extension to github.com/sirupsen/logrus that includes a cloudwatch logs logger
Index ¶
Constants ¶
View Source
const ( TRACE = logrus.TraceLevel DEBUG = logrus.DebugLevel INFO = logrus.InfoLevel WARNING = logrus.WarnLevel ERROR = logrus.ErrorLevel FATAL = logrus.FatalLevel PANIC = logrus.PanicLevel )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CloudWatchLogWriter ¶
type CloudWatchLogWriter struct { GroupName *string StreamName *string KMSKeyId *string GroupTags map[string]*string // contains filtered or unexported fields }
CloudWatchLogWriter used as a writer for putting events into cloudwatch logs
func NewCloudWatchLogWriter ¶
func NewCloudWatchLogWriter(sess *session.Session, groupName, streamName string) *CloudWatchLogWriter
NewCloudWatchLogWriter creates a new CloudWatchLogWriter with given aws session, group name and stream name
func (*CloudWatchLogWriter) AddTags ¶
func (c *CloudWatchLogWriter) AddTags(tags map[string]string) *CloudWatchLogWriter
AddTags adds tags to the cloudwatch group
func (*CloudWatchLogWriter) SetKMSKeyID ¶
func (c *CloudWatchLogWriter) SetKMSKeyID(kmsKey string) *CloudWatchLogWriter
SetKMSKeyID sets the KMS key Id for this CloudWatchLogWriter
type Logrus ¶
type Logrus interface { StandardLogger WithFields(fields logrus.Fields) *logrus.Entry WithField(key string, value interface{}) *logrus.Entry }
Logrus allows passing of a logger or entry
type StandardLogger ¶
type StandardLogger interface { Debug(...interface{}) Info(...interface{}) Warn(...interface{}) Error(...interface{}) Fatal(...interface{}) Panic(...interface{}) Debugf(string, ...interface{}) Infof(string, ...interface{}) Warnf(string, ...interface{}) Errorf(string, ...interface{}) Fatalf(string, ...interface{}) Panicf(string, ...interface{}) }
StandardLogger is used in place of a standard logger instance to ensure compatibility with any logger
type Writer ¶
type Writer struct { Writer io.Writer `validate:"required"` LogLevels []logrus.Level Format logrus.Formatter }
Writer represents a single Logger handler that implements the logrus hook interface
Click to show internal directories.
Click to hide internal directories.