Documentation
¶
Index ¶
- Constants
- func Any(key string, value any) zap.Field
- func AttrsToFields(args ...any) []zap.Field
- func Bool(key string, value bool) zap.Field
- func Bytes(value int) zap.Field
- func Component(value string) zap.Field
- func ConnectionID(value string) zap.Field
- func CorrelationFields(ctx context.Context) []zap.Field
- func Debug(msg string, args ...any)
- func DebugContext(ctx context.Context, msg string, args ...any)
- func Decision(value string) zap.Field
- func Dependency(value string) zap.Field
- func DurationMS(value time.Duration) zap.Field
- func DurationMSFloat(value time.Duration) zap.Field
- func Error(msg string, args ...any)
- func ErrorCode(value string) zap.Field
- func ErrorContext(ctx context.Context, msg string, args ...any)
- func ErrorField(err error) zap.Field
- func ErrorMessage(value string) zap.Field
- func ForwardedFor(value string) zap.Field
- func HTTPRequestFields(r *http.Request) []zap.Field
- func Info(msg string, args ...any)
- func InfoContext(ctx context.Context, msg string, args ...any)
- func InstanceID(value string) zap.Field
- func Int(key string, value int) zap.Field
- func Int64(key string, value int64) zap.Field
- func Kind(value string) zap.Field
- func L() *zap.Logger
- func LogDependencyFailure(logger *zap.Logger, ctx context.Context, event DependencyFailure)
- func LogPhase(logger *zap.Logger, ctx context.Context, event PhaseLog)
- func LogRequestComplete(logger *zap.Logger, ctx context.Context, event RequestComplete)
- func Method(value string) zap.Field
- func New(cfg Config) (*zap.Logger, error)
- func NewGORMLogger(opts GormOptions) gormlogger.Interface
- func Operation(value string) zap.Field
- func Path(value string) zap.Field
- func Phase(value string) zap.Field
- func ProfileID(value string) zap.Field
- func ProjectID(value string) zap.Field
- func RealIP(value string) zap.Field
- func Reason(value string) zap.Field
- func RedactedValue() string
- func RegisterContextFieldExtractor(extractor ContextFieldExtractor)
- func RemoteAddr(value string) zap.Field
- func RequestID(value string) zap.Field
- func Route(value string) zap.Field
- func RunID(value string) zap.Field
- func SanitizeURL(raw string) (host string, path string)
- func SanitizeURLRequest(req *http.Request) (host string, path string)
- func SanitizeURLRequestURL(rawURL *url.URL) (host string, path string)
- func ServerID(value string) zap.Field
- func Service(value string) zap.Field
- func SetDefault(logger *zap.Logger)
- func SpanID(value string) zap.Field
- func Status(value int) zap.Field
- func String(key string, value string) zap.Field
- func TenantID(value string) zap.Field
- func TokenPresent(token string) bool
- func TraceID(value string) zap.Field
- func TraceSampled(value bool) zap.Field
- func URLHost(value string) zap.Field
- func URLPath(value string) zap.Field
- func UserAgent(value string) zap.Field
- func UserID(value string) zap.Field
- func Warn(msg string, args ...any)
- func WarnContext(ctx context.Context, msg string, args ...any)
- func WithInstanceID(ctx context.Context, value string) context.Context
- func WithProjectID(ctx context.Context, value string) context.Context
- func WithRequestID(ctx context.Context, value string) context.Context
- func WithRunID(ctx context.Context, value string) context.Context
- func WithServerID(ctx context.Context, value string) context.Context
- func WithTenantID(ctx context.Context, value string) context.Context
- func WithUserID(ctx context.Context, value string) context.Context
- func WithWorkflowID(ctx context.Context, value string) context.Context
- func WorkflowID(value string) zap.Field
- type Config
- type ContextFieldExtractor
- type DependencyFailure
- type GormOptions
- type Level
- type PhaseLog
- type RequestComplete
Constants ¶
View Source
const ( FormatText = "text" FormatPrettyText = "prettytext" FormatJSON = "json" )
View Source
const ( LevelDebug = zapcore.DebugLevel LevelInfo = zapcore.InfoLevel LevelWarn = zapcore.WarnLevel LevelError = zapcore.ErrorLevel )
Variables ¶
This section is empty.
Functions ¶
func AttrsToFields ¶ added in v0.1.1
func ConnectionID ¶
func Dependency ¶
func ErrorField ¶ added in v0.1.1
func ErrorMessage ¶
func ForwardedFor ¶ added in v0.1.1
func InstanceID ¶
func LogDependencyFailure ¶
func LogDependencyFailure(logger *zap.Logger, ctx context.Context, event DependencyFailure)
func LogRequestComplete ¶
func LogRequestComplete(logger *zap.Logger, ctx context.Context, event RequestComplete)
func NewGORMLogger ¶ added in v0.1.1
func NewGORMLogger(opts GormOptions) gormlogger.Interface
func RedactedValue ¶
func RedactedValue() string
func RegisterContextFieldExtractor ¶ added in v0.1.1
func RegisterContextFieldExtractor(extractor ContextFieldExtractor)
func RemoteAddr ¶
func SanitizeURL ¶
func SetDefault ¶ added in v0.1.1
func TokenPresent ¶
func TraceSampled ¶ added in v0.1.1
func WorkflowID ¶
Types ¶
type Config ¶
type Config struct {
Service string
Format string
Level string
Output io.Writer
AddCaller bool
DisableCaller bool
StacktraceLevel string
}
Config controls shared logger construction for Go backend services.
type ContextFieldExtractor ¶ added in v0.1.1
type DependencyFailure ¶
type DependencyFailure struct {
Message string
Dependency string
Operation string
Activity string
Method string
URLHost string
URLPath string
Status int
Duration time.Duration
ErrorCode string
Err error
Fields []any
}
func ObserveHTTPDependency ¶
type GormOptions ¶ added in v0.1.1
Click to show internal directories.
Click to hide internal directories.