Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
DefaultRemovedFields = []string{"component", "team", "service", "run_id"}
)
var I = Base()
I Global logger instance for use through the app
Functions ¶
func AddGlobalTags ¶
AddGlobalTags adds global tags to all application loggers.
func GetLogrusFormatter ¶ added in v1.3.1
func NewFilteredTextFormatter ¶ added in v1.3.2
Types ¶
type FilteredTextFormatter ¶ added in v1.3.2
type FilteredTextFormatter struct {
// contains filtered or unexported fields
}
FilteredTextFormatter is a logrus.TextFormatter that filters out some specific fields that are not needed for humans. These fields are usually more helpful for machines, and with json formatting for example.
type KubehoundLogger ¶
Require our logger to append job or API related fields for easier filtering and parsing of logs within custom dashboards. Sticking to the "structured" log types also enables out of the box correlation of APM traces and log messages without the need for a custom index pipeline. See: https://docs.datadoghq.com/logs/log_collection/go/#configure-your-logger
func Trace ¶
func Trace(ctx context.Context, opts ...LoggerOption) *KubehoundLogger
Trace creates a logger from the current context, attaching trace and span IDs for use with APM.
type LoggerConfig ¶
type LoggerOption ¶
func WithCollectedCluster ¶ added in v1.3.1
func WithCollectedCluster(name string) LoggerOption
WithCollectedCluster adds a component name tag to the logger.
func WithComponent ¶
func WithComponent(name string) LoggerOption
WithComponent adds a component name tag to the logger.