Documentation ¶
Overview ¶
Package logger contains the configuration structures needed to configure the access to CloudWatch server to sending the log messages there.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var AWSCloudWatchEndpoint string
AWSCloudWatchEndpoint allows you to mock cloudwatch client by redirecting requests to a local proxy
Functions ¶
func InitZerolog ¶
func InitZerolog( loggingConf LoggingConfiguration, cloudWatchConf CloudWatchConfiguration, additionalWriters ...io.Writer, ) error
InitZerolog initializes zerolog with provided configs to use proper stdout and/or CloudWatch logging
Types ¶
type CloudWatchConfiguration ¶
type CloudWatchConfiguration struct { AWSAccessID string `mapstructure:"aws_access_id" toml:"aws_access_id"` AWSSecretKey string `mapstructure:"aws_secret_key" toml:"aws_secret_key"` AWSSessionToken string `mapstructure:"aws_session_token" toml:"aws_session_token"` AWSRegion string `mapstructure:"aws_region" toml:"aws_region"` LogGroup string `mapstructure:"log_group" toml:"log_group"` StreamName string `mapstructure:"stream_name" toml:"stream_name"` CreateStreamIfNotExists bool `mapstructure:"create_stream_if_not_exists" toml:"create_stream_if_not_exists"` // enable debug logs for debugging aws client itself Debug bool `mapstructure:"debug" toml:"debug"` }
CloudWatchConfiguration represents configuration of CloudWatch logger
type LoggingConfiguration ¶
type LoggingConfiguration struct { // Debug enables pretty colored logging Debug bool `mapstructure:"debug" toml:"debug"` // LogLevel sets logging level to show. Possible values are: // "debug" // "info" // "warn", "warning" // "error" // "fatal" // // logging level won't be changed if value is not one of listed above LogLevel string `mapstructure:"log_level" toml:"log_level"` // LoggingToCloudWatchEnabled enables logging to CloudWatch // (configuration for CloudWatch is in CloudWatchConfiguration) LoggingToCloudWatchEnabled bool `mapstructure:"logging_to_cloud_watch_enabled" toml:"logging_to_cloud_watch_enabled"` }
LoggingConfiguration represents configuration for logging in general
type SaramaZerologger ¶
type SaramaZerologger struct {
// contains filtered or unexported fields
}
SaramaZerologger is a wrapper to make sarama log to zerolog those logs can be filtered by key "package" with value "sarama"
func (*SaramaZerologger) Print ¶
func (logger *SaramaZerologger) Print(params ...interface{})
Print wraps print method
func (*SaramaZerologger) Printf ¶
func (logger *SaramaZerologger) Printf(format string, params ...interface{})
Printf wraps printf method
func (*SaramaZerologger) Println ¶
func (logger *SaramaZerologger) Println(v ...interface{})
Println wraps println method
type WorkaroundForRHIOPS729 ¶
WorkaroundForRHIOPS729 keeps only those fields that are currently getting their way to Kibana TODO: delete when RHIOPS-729 is fixed