productlogging

package
v0.11.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultLoggerLevel = "INFO"
	RootLoggerName     = "ROOT"

	DefaultLog4jConversionPattern   = "[%d] %p %m (%c)%n"
	DefaultLog4j2ConversionPattern  = "%d{ISO8601} %-5p %m%n"
	DefaultLogbackConversionPattern = "%d{ISO8601} %-5p [%t:%C{1}@%L] - %m%n"

	DefaultRotatingFileHandlerMaxBytes float64 = 10.0 * 1024 * 1024
)

Variables

This section is empty.

Functions

func CalculateLogVolumeSizeLimit

func CalculateLogVolumeSizeLimit(maxLogFilesSize []resource.Quantity) resource.Quantity

calculate_log_volume_size_limit calculates the log volume size limit based on the given max log file sizes. The limit is calculated by summing up all the given sizes, scaling the result to MEBI and multiplying it by 3.0. The result is then ceiled to avoid bulky numbers due to floating-point arithmetic.

func JavaLogTemplateValue added in v0.11.0

func JavaLogTemplateValue(loggingConfig LoggingConfig, productLogging *ProductLogging) map[string]interface{}

func MakeVectorYaml

func MakeVectorYaml(
	ctx context.Context,
	client ctrlclient.Client,
	namespace string,
	cluster string,
	roleName string,
	roleGroupName string,
	vectorAggregatorDiscovery string,
) (string, error)

Types

type ConfigGenerator added in v0.11.0

type ConfigGenerator struct {
	// contains filtered or unexported fields
}

func NewConfigGenerator added in v0.11.0

func NewConfigGenerator(
	loggingConfigSpec *loggingv1alpha1.LoggingConfigSpec,
	containerName string,
	logFileName string,
	logType LogType,
	opts ...ConfigGeneratorOptionFunc,
) (*ConfigGenerator, error)

func (*ConfigGenerator) Content added in v0.11.0

func (l *ConfigGenerator) Content() (string, error)

type ConfigGeneratorOption added in v0.11.2

type ConfigGeneratorOption struct {
	LogFileMaxBytes         *float64
	ConsoleHandlerFormatter *string
}

type ConfigGeneratorOptionFunc added in v0.11.2

type ConfigGeneratorOptionFunc func(*ConfigGeneratorOption)

type Log4j2Config added in v0.11.0

type Log4j2Config struct {
	// contains filtered or unexported fields
}

Log4j2Config is a struct that contains log4j2 logging configuration

func (*Log4j2Config) Content added in v0.11.0

func (l *Log4j2Config) Content() (string, error)

Content implements the LoggingConfig interface

func (*Log4j2Config) LoggerFormatter added in v0.11.0

func (l *Log4j2Config) LoggerFormatter(name string, level string) string

LoggerFormatter implements the LoggingConfig interface

func (*Log4j2Config) String added in v0.11.0

func (l *Log4j2Config) String() string

String implements the LoggingConfig interface

func (*Log4j2Config) Template added in v0.11.0

func (l *Log4j2Config) Template() string

Template implements the LoggingConfig interface

type Log4jConfig added in v0.11.0

type Log4jConfig struct {
	// contains filtered or unexported fields
}

Log4jConfig is a struct that holds the configuration for log4j logging

func (*Log4jConfig) Content added in v0.11.0

func (l *Log4jConfig) Content() (string, error)

Content implements LoggingConfig.

func (*Log4jConfig) LoggerFormatter added in v0.11.0

func (l *Log4jConfig) LoggerFormatter(name string, level string) string

LoggerFormatter implements LoggingConfig.

func (*Log4jConfig) String added in v0.11.0

func (l *Log4jConfig) String() string

String implements LoggingConfig.

func (*Log4jConfig) Template added in v0.11.0

func (l *Log4jConfig) Template() string

Template implements LoggingConfig.

type LogType added in v0.11.0

type LogType int
const (
	LogTypeLog4j LogType = iota
	LogTypeLog4j2
	LogTypeLogback
	LogTypePythonLogging
)

type LogbackConfig added in v0.11.0

type LogbackConfig struct {
	// contains filtered or unexported fields
}

LogbackConfig is a struct that contains logback logging configuration

func (*LogbackConfig) Content added in v0.11.0

func (l *LogbackConfig) Content() (string, error)

Content implements the LoggingConfig interface

func (*LogbackConfig) LoggerFormatter added in v0.11.0

func (l *LogbackConfig) LoggerFormatter(name string, level string) string

LoggerFormatter implements the LoggingConfig interface

func (*LogbackConfig) String added in v0.11.0

func (l *LogbackConfig) String() string

String implements the LoggingConfig interface

func (*LogbackConfig) Template added in v0.11.0

func (l *LogbackConfig) Template() string

Template implements the LoggingConfig interface

type LoggingConfig added in v0.11.0

type LoggingConfig interface {
	Template() string
	LoggerFormatter(name, level string) string
	String() string
	Content() (string, error)
}

type ProductLogging added in v0.11.0

type ProductLogging struct {
	RootLogLevel string
	// log msg format
	ConsoleHandlerFormatter string
	ConsoleHandlerLevel     string

	RotatingFileHandlerLevel       string
	RotatingFileHandlerFile        string
	RotatingFileHandlerMaxBytes    float64
	RotatingFileHandlerBackupCount int

	Loggers map[string]loggingv1alpha1.LogLevelSpec
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL