Documentation ¶
Index ¶
- Constants
- func TraceContext(ctx context.Context) []zapcore.Field
- type Core
- func (c *Core) Check(entry zapcore.Entry, checked *zapcore.CheckedEntry) *zapcore.CheckedEntry
- func (*Core) Enabled(level zapcore.Level) bool
- func (*Core) Sync() error
- func (c *Core) With(fields []zapcore.Field) zapcore.Core
- func (c *Core) WrapCore(core zapcore.Core) zapcore.Core
- func (c *Core) Write(entry zapcore.Entry, fields []zapcore.Field) error
Constants ¶
View Source
const ( // FieldKeyTraceID is the field key for the trace ID. FieldKeyTraceID = "trace.id" // FieldKeyTransactionID is the field key for the transaction ID. FieldKeyTransactionID = "transaction.id" // FieldKeySpanID is the field key for the span ID. FieldKeySpanID = "span.id" )
View Source
const ( // DefaultFatalFlushTimeout is the default value for Hook.FatalFlushTimeout. DefaultFatalFlushTimeout = 5 * time.Second )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Core ¶
type Core struct { // Tracer is the apm.Tracer to use for reporting errors. // If Tracer is nil, then apm.DefaultTracer() will be used. Tracer *apm.Tracer // FatalFlushTimeout is the amount of time to wait while // flushing a fatal log message to the APM Server before // the process is exited. If this is 0, then // DefaultFatalFlushTimeout will be used. If the timeout // is a negative value, then no flushing will be performed. FatalFlushTimeout time.Duration }
Core is an implementation of zapcore.Core, reporting log records as errors to the APM Server. If TraceContext is used to add trace IDs to the log records, the errors reported will be associated with them.
func (*Core) Check ¶
func (c *Core) Check(entry zapcore.Entry, checked *zapcore.CheckedEntry) *zapcore.CheckedEntry
Check checks if the entry should be logged, and adds c to checked if so.
Click to show internal directories.
Click to hide internal directories.