Documentation
¶
Index ¶
- Constants
- func AddFields(ctx context.Context, fields Fields) context.Context
- func CloseWriters() error
- func GetLogFileOutputPath(outputs []string) string
- func HasLogFileOutput(outputs []string) bool
- func Level() string
- func SetLevel(level string)
- func SetOutputFormat(format string, opts ...OutputFormatOptionFunc)
- func SetOutputs(outputs []string, fileMaxSizeMB, filesKeep int) error
- type AWSAdapter
- type DummyLogger
- func (d DummyLogger) Debug(args ...any)
- func (d DummyLogger) Debugf(format string, args ...any)
- func (d DummyLogger) Error(args ...any)
- func (d DummyLogger) Errorf(format string, args ...any)
- func (d DummyLogger) Fatal(args ...any)
- func (d DummyLogger) Fatalf(format string, args ...any)
- func (d DummyLogger) Info(args ...any)
- func (d DummyLogger) Infof(format string, args ...any)
- func (d DummyLogger) IsDebugging() bool
- func (d DummyLogger) IsError() bool
- func (d DummyLogger) IsInfo() bool
- func (d DummyLogger) IsTracing() bool
- func (d DummyLogger) IsWarn() bool
- func (d DummyLogger) Log(level logrus.Level, args ...any)
- func (d DummyLogger) Logf(level logrus.Level, format string, args ...any)
- func (d DummyLogger) Panic(args ...any)
- func (d DummyLogger) Panicf(format string, args ...any)
- func (d DummyLogger) Trace(args ...any)
- func (d DummyLogger) Tracef(format string, args ...any)
- func (d DummyLogger) Warn(args ...any)
- func (d DummyLogger) Warnf(format string, args ...any)
- func (d DummyLogger) Warning(args ...any)
- func (d DummyLogger) Warningf(format string, args ...any)
- func (d DummyLogger) WithContext(ctx context.Context) Logger
- func (d DummyLogger) WithError(err error) Logger
- func (d DummyLogger) WithField(key string, value any) Logger
- func (d DummyLogger) WithFields(fields Fields) Logger
- type Fields
- type Logger
- type OutputFormatOptionFunc
- type OutputFormatOptions
Constants ¶
View Source
const ( LogFieldsContextKey = contextKey("log_fields") ProjectDirectoryName = "lakefs" ModuleName = "github.com/treeverse/lakefs" )
View Source
const ( // RepositoryFieldKey repository name (string) RepositoryFieldKey = "repository" // MatchedHostFieldKey matched host (bool) true when domain extracted from host MatchedHostFieldKey = "matched_host" // RefHostFieldKey reference id (string) RefHostFieldKey = "ref" // PathFieldKey path / request URI (string) PathFieldKey = "path" // UploadIDFieldKey s3 multipart upload ID (string) "upload_id" UploadIDFieldKey = "upload_id" // ListTypeFieldKey s3 list type version (string, ex: v1 or v2) ListTypeFieldKey = "list_type" // PhysicalAddressFieldKey object physical address (string) PhysicalAddressFieldKey = "physical_address" // PartNumberFieldKey s3 multipart upload part number (string) PartNumberFieldKey = "part_number" // RequestIDFieldKey request ID (string) based on the request ID found on context RequestIDFieldKey = "request_id" // HostFieldKey request's host (string) HostFieldKey = "host" // MethodFieldKey request's method (string) MethodFieldKey = "method" // UserFieldKey user's name associated with the request (string) UserFieldKey = "user" // ServiceNameFieldKey service name (string, ex: rest_api) ServiceNameFieldKey = "service_name" // LogAudit kind of information to audit (string, ex: API) LogAudit = "log_audit" )
log_fields keys
Variables ¶
This section is empty.
Functions ¶
func CloseWriters ¶ added in v1.2.0
func CloseWriters() error
func GetLogFileOutputPath ¶ added in v1.28.0
func HasLogFileOutput ¶ added in v1.28.0
func SetOutputFormat ¶ added in v0.40.2
func SetOutputFormat(format string, opts ...OutputFormatOptionFunc)
func SetOutputs ¶ added in v0.60.1
Types ¶
type AWSAdapter ¶ added in v0.40.2
type AWSAdapter struct {
Logger Logger
}
func (*AWSAdapter) Logf ¶ added in v0.110.0
func (l *AWSAdapter) Logf(classification logging.Classification, format string, v ...any)
type DummyLogger ¶
type DummyLogger struct{}
func (DummyLogger) Debug ¶
func (d DummyLogger) Debug(args ...any)
func (DummyLogger) Debugf ¶
func (d DummyLogger) Debugf(format string, args ...any)
func (DummyLogger) Error ¶
func (d DummyLogger) Error(args ...any)
func (DummyLogger) Errorf ¶
func (d DummyLogger) Errorf(format string, args ...any)
func (DummyLogger) Fatal ¶
func (d DummyLogger) Fatal(args ...any)
func (DummyLogger) Fatalf ¶
func (d DummyLogger) Fatalf(format string, args ...any)
func (DummyLogger) Info ¶
func (d DummyLogger) Info(args ...any)
func (DummyLogger) Infof ¶
func (d DummyLogger) Infof(format string, args ...any)
func (DummyLogger) IsDebugging ¶ added in v0.93.0
func (d DummyLogger) IsDebugging() bool
func (DummyLogger) IsError ¶ added in v0.93.0
func (d DummyLogger) IsError() bool
func (DummyLogger) IsInfo ¶ added in v0.93.0
func (d DummyLogger) IsInfo() bool
func (DummyLogger) IsTracing ¶
func (d DummyLogger) IsTracing() bool
func (DummyLogger) IsWarn ¶ added in v0.93.0
func (d DummyLogger) IsWarn() bool
func (DummyLogger) Logf ¶ added in v0.68.0
func (d DummyLogger) Logf(level logrus.Level, format string, args ...any)
func (DummyLogger) Panic ¶
func (d DummyLogger) Panic(args ...any)
func (DummyLogger) Panicf ¶
func (d DummyLogger) Panicf(format string, args ...any)
func (DummyLogger) Trace ¶
func (d DummyLogger) Trace(args ...any)
func (DummyLogger) Tracef ¶
func (d DummyLogger) Tracef(format string, args ...any)
func (DummyLogger) Warn ¶
func (d DummyLogger) Warn(args ...any)
func (DummyLogger) Warnf ¶
func (d DummyLogger) Warnf(format string, args ...any)
func (DummyLogger) Warning ¶
func (d DummyLogger) Warning(args ...any)
func (DummyLogger) Warningf ¶
func (d DummyLogger) Warningf(format string, args ...any)
func (DummyLogger) WithContext ¶
func (d DummyLogger) WithContext(ctx context.Context) Logger
func (DummyLogger) WithError ¶
func (d DummyLogger) WithError(err error) Logger
func (DummyLogger) WithFields ¶
func (d DummyLogger) WithFields(fields Fields) Logger
type Fields ¶
func GetFieldsFromContext ¶ added in v1.12.0
GetFieldsFromContext returns the logging fields on ctx or nil.
type Logger ¶
type Logger interface {
WithContext(ctx context.Context) Logger
WithField(key string, value any) Logger
WithFields(fields Fields) Logger
WithError(err error) Logger
Trace(args ...any)
Debug(args ...any)
Info(args ...any)
Warn(args ...any)
Warning(args ...any)
Error(args ...any)
Fatal(args ...any)
Panic(args ...any)
Log(level logrus.Level, args ...any)
Tracef(format string, args ...any)
Debugf(format string, args ...any)
Infof(format string, args ...any)
Warnf(format string, args ...any)
Warningf(format string, args ...any)
Errorf(format string, args ...any)
Fatalf(format string, args ...any)
Panicf(format string, args ...any)
Logf(level logrus.Level, format string, args ...any)
IsTracing() bool
IsDebugging() bool
IsInfo() bool
IsError() bool
IsWarn() bool
}
func ContextUnavailable ¶ added in v0.105.0
func ContextUnavailable() Logger
ContextUnavailable returns a Logger when no context is available. It should be used only in code during startup, teardown, or tests. Prefer to use Default().
func ContextUnavailableWithSysLogs ¶ added in v1.36.0
func FromContext ¶
FromContext returns a Logger for reporting logs during ctx. This logger will typically include request IDs from the context.
type OutputFormatOptionFunc ¶ added in v0.104.0
type OutputFormatOptionFunc func(options *OutputFormatOptions)
Click to show internal directories.
Click to hide internal directories.