Help us shape the future of Go! Take the 2026 Go Developer Survey

cdslog

package
v0.55.2 Latest Latest
Warning

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

Go to latest
Published: May 7, 2025 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// If you add a field constant, don't forget to add it in the log.RegisterField below
	Action             = log.Field("action")
	AuthConsumerID     = log.Field("auth_consumer_id")
	AuthServiceName    = log.Field("auth_service_name")
	AuthServiceType    = log.Field("auth_service_type")
	AuthSessionIAT     = log.Field("auth_session_iat")
	AuthSessionID      = log.Field("auth_session_id")
	AuthSessionTokenID = log.Field("auth_session_token")
	AuthUserID         = log.Field("auth_user_id")
	AuthHatcheryID     = log.Field("auth_hatchery_id")
	AuthUsername       = log.Field("auth_user_name")
	AuthWorkerName     = log.Field("auth_worker_name")
	RbackCheckerName   = log.Field("rbac_checker_name")
	Commit             = log.Field("commit")
	Deprecated         = log.Field("deprecated")
	Duration           = log.Field("duration_milliseconds_num")
	Goroutine          = log.Field("goroutine")
	Handler            = log.Field("handler")
	HookEventID        = log.Field("hook_event_id")
	IPAddress          = log.Field("ip_address")
	Latency            = log.Field("latency")
	LatencyNum         = log.Field("latency_num")
	Method             = log.Field("method")
	GpgKey             = log.Field("gpg_key")
	RbacRole           = log.Field("rbac_role")
	RequestID          = log.Field("request_id")
	RequestURI         = log.Field("request_uri")
	Repository         = log.Field("repository")
	Operation          = log.Field("operation")
	Route              = log.Field("route")
	Service            = log.Field("service")
	Size               = log.Field("size_num")
	Stacktrace         = log.Field("stack_trace")
	Status             = log.Field("status")
	StatusNum          = log.Field("status_num")
	Sudo               = log.Field("sudo")
	VCSServer          = log.Field("vcs_server")
	KafkaBroker        = log.Field("kafka_broker")
	KafkaTopic         = log.Field("kafka_topic")
	AnalyzeID          = log.Field("analyze_id")
	NodeRunID          = log.Field("node_run_id")
	PermJobID          = log.Field("permJobID")
	Workflow           = log.Field("workflow")
	WorkflowRunID      = log.Field("workflow_run_id")
	Component          = log.Field("component")
	Project            = log.Field("project")
	ConcurrencyName    = log.Field("concurrency_name")
	ConcurrencyScope   = log.Field("concurrency_scope")
)
View Source
const (
	HeaderRequestID      = "Request-ID"
	ExtraFieldSignature  = "Signature"
	ExtraFieldLine       = "Line"
	ExtraFieldTerminated = "Terminated"
)

Variables

This section is empty.

Functions

func ContextValue

func ContextValue(ctx context.Context, f log.Field) string

func Flush

func Flush(ctx context.Context, l *logrus.Logger)

For given logrus logger, try to flush hooks

func Initialize

func Initialize(ctx context.Context, conf *Conf)

Initialize init log level

func New

func New(ctx context.Context, graylogcfg *graylog.Config) (*logrus.Logger, *graylog.Hook, error)

func ReplaceAllHooks

func ReplaceAllHooks(ctx context.Context, l *logrus.Logger, graylogcfg *graylog.Config) error

Types

type CDSFormatter

type CDSFormatter struct {
	Fields []string
}

CDSFormatter ...

func (*CDSFormatter) Format

func (f *CDSFormatter) Format(entry *logrus.Entry) ([]byte, error)

Format format a log

type Conf

type Conf struct {
	Level                      string
	Format                     string
	TextFields                 []string
	SkipTextFields             []string
	GraylogHost                string
	GraylogPort                string
	GraylogProtocol            string
	GraylogExtraKey            string
	GraylogExtraValue          string
	GraylogFieldCDSServiceType string
	GraylogFieldCDSServiceName string
	GraylogFieldCDSVersion     string
	GraylogFieldCDSOS          string
	GraylogFieldCDSArch        string
	SyslogHost                 string
	SyslogPort                 string
	SyslogProtocol             string
	SyslogExtraTag             string
}

Conf contains log configuration

type Message

type Message struct {
	Value     string
	Level     logrus.Level
	Signature cdn.Signature
}

func (Message) ServiceKey

func (m Message) ServiceKey() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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