logs

package module
v0.74.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2026 License: Apache-2.0 Imports: 12 Imported by: 3

Documentation

Overview

Package logs contain methods to configure Agent logs

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildJMXLogger added in v0.71.0

func BuildJMXLogger(logFile, syslogURI string, syslogRFC, logToConsole, jsonFormat bool, cfg pkgconfigmodel.Reader) (log.LoggerInterface, error)

BuildJMXLogger returns a logger with JMX logger name and log level if a non empty logFile is provided, it will also log to the file a non empty syslogURI will enable syslog, and format them following RFC 5424 if specified you can also specify to log to the console and in JSON format

func GetSyslogURI

func GetSyslogURI(cfg pkgconfigmodel.Reader) string

GetSyslogURI returns the configured/default syslog uri. Returns an empty string when syslog is disabled.

func NewLogWriter

func NewLogWriter(additionalDepth int, logLevel log.LogLevel) (io.Writer, error)

NewLogWriter returns a logWriter set with given logLevel. Returns an error if logLevel is unknown/not set.

func NewTLSHandshakeErrorWriter

func NewTLSHandshakeErrorWriter(additionalDepth int, logLevel log.LogLevel) (io.Writer, error)

NewTLSHandshakeErrorWriter is a wrapper function which creates a new logWriter.

func SetupDogstatsdLogger

func SetupDogstatsdLogger(logFile string, cfg pkgconfigmodel.Reader) (log.LoggerInterface, error)

SetupDogstatsdLogger returns a logger with dogstatsd logger name and log level if a non empty logFile is provided, it will also log to the file

func SetupLogger

func SetupLogger(loggerName LoggerName, logLevel, logFile, syslogURI string, syslogRFC, logToConsole, jsonFormat bool, cfg pkgconfigmodel.Reader) error

SetupLogger sets up a logger with the specified logger name and log level if a non empty logFile is provided, it will also log to the file a non empty syslogURI will enable syslog, and format them following RFC 5424 if specified you can also specify to log to the console and in JSON format

Types

type LoggerName

type LoggerName string

LoggerName specifies the name of an instantiated logger.

const (
	CoreLoggerName      LoggerName = "CORE"
	JMXLoggerName       LoggerName = "JMXFETCH"
	DogstatsDLoggerName LoggerName = "DOGSTATSD"
)

Constant values for LoggerName.

Directories

Path Synopsis
internal
seelog
Package seelog provides the configuration for the logger
Package seelog provides the configuration for the logger

Jump to

Keyboard shortcuts

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