Documentation ¶
Index ¶
- Constants
- func AtomicLevel() zap.AtomicLevel
- func FCodeInstance(v string) zap.Field
- func FCodeLine(v int) zap.Field
- func FCodeMethod(v string) zap.Field
- func FCodePackage(v string) zap.Field
- func FDuration(duration time.Duration) zap.Field
- func FDurationFn() func() zap.Field
- func FDurationHour(duration time.Duration) zap.Field
- func FDurationMin(duration time.Duration) zap.Field
- func FDurationSec(duration time.Duration) zap.Field
- func FError(err error) zap.Field
- func FErrorType(err error) zap.Field
- func FHTTPClientIP(clientIP string) zap.Field
- func FHTTPFlavor(flavor string) zap.Field
- func FHTTPHost(host string) zap.Field
- func FHTTPMethod(name string) zap.Field
- func FHTTPRequestContentLength(bytes int64) zap.Field
- func FHTTPRequestID(id string) zap.Field
- func FHTTPScheme(scheme string) zap.Field
- func FHTTPServerName(id string) zap.Field
- func FHTTPSessionID(id string) zap.Field
- func FHTTPStatusCode(status int) zap.Field
- func FHTTPTarget(target string) zap.Field
- func FHTTPTrackingID(id string) zap.Field
- func FHTTPUserAgent(userAgent string) zap.Field
- func FHTTPWroteBytes(bytes int64) zap.Field
- func FJSON(v interface{}) zap.Field
- func FMessagingConversationID(value string) zap.Field
- func FMessagingDestination(value string) zap.Field
- func FMessagingDestinationKind(value MessagingDestinationKind) zap.Field
- func FMessagingMessageID(value string) zap.Field
- func FMessagingMessagePayloadCompressedSizeBytes(value string) zap.Field
- func FMessagingMessagePayloadSizeBytes(value string) zap.Field
- func FMessagingProtocol(value string) zap.Field
- func FMessagingProtocolVersion(value string) zap.Field
- func FMessagingSystem(value string) zap.Field
- func FMessagingURL(value string) zap.Field
- func FName(name string) zap.Field
- func FNetHostIP(ip string) zap.Field
- func FNetHostPort(port string) zap.Field
- func FNum(num int) zap.Field
- func FPeerService(name string) zap.Field
- func FServiceInstanceID(id string) zap.Field
- func FServiceMethod(method string) zap.Field
- func FServiceName(name string) zap.Field
- func FServiceNamespace(namespace string) zap.Field
- func FServiceVersion(version string) zap.Field
- func FStackSkip(skip int) zap.Field
- func FStreamQueue(queue string) zap.Field
- func FStreamSubject(name string) zap.Field
- func FTraceID(traceID string) zap.Field
- func FValue(value interface{}) zap.Field
- func IsDisableCaller() bool
- func IsDisableStacktrace() bool
- func Logger() *zap.Logger
- func Must(l *zap.Logger, err error, msgAndArgs ...interface{})
- func SetDisableCaller(value bool) error
- func SetDisableStacktrace(value bool) error
- func With(l *zap.Logger, fields ...zap.Field) *zap.Logger
- func WithError(l *zap.Logger, err error) *zap.Logger
- func WithHTTPClientIP(l *zap.Logger, r *http.Request) *zap.Logger
- func WithHTTPFlavor(l *zap.Logger, r *http.Request) *zap.Logger
- func WithHTTPHost(l *zap.Logger, r *http.Request) *zap.Logger
- func WithHTTPRequest(l *zap.Logger, r *http.Request) *zap.Logger
- func WithHTTPRequestID(l *zap.Logger, r *http.Request) *zap.Logger
- func WithHTTPRequestOut(l *zap.Logger, r *http.Request) *zap.Logger
- func WithHTTPScheme(l *zap.Logger, r *http.Request) *zap.Logger
- func WithHTTPServerName(l *zap.Logger, name string) *zap.Logger
- func WithHTTPSessionID(l *zap.Logger, r *http.Request) *zap.Logger
- func WithHTTPTrackingID(l *zap.Logger, r *http.Request) *zap.Logger
- func WithServiceName(l *zap.Logger, name string) *zap.Logger
- func WithTraceID(l *zap.Logger, ctx context.Context) *zap.Logger
- type Config
- type MessagingDestinationKind
Constants ¶
View Source
const ( // NumKey - generic number attribute NumKey = "num" // NameKey - generic name attribute NameKey = "name" // ValueKey - generic value attribute ValueKey = "value" // JSONKey - generic json attribute JSONKey = "json" )
View Source
const ( CodeInstanceKey = "code_instance" CodePackageKey = "code_package" CodeMethodKey = "code_method" CodeLineKey = "code_line" )
View Source
const ( DurationKey = "duration" DurationSecKey = "duration_sec" DurationMinKey = "duration_min" DurationHourKey = "duration_hour" )
View Source
const ( ErrorTypeKey = "error_type" ErrorMessageKey = "error_message" ErrorStacktraceKey = "error_stacktrace" )
View Source
const ( // HTTPServerNameKey represents the name of the service handling the request HTTPServerNameKey = "http_server_name" // HTTPMethodKey represents the HTTP request method. HTTPMethodKey = "http_method" // HTTPTargetKey represents the full request target as passed in a HTTP // request line or equivalent, e.g. "/path/12314/?q=ddds#123". HTTPTargetKey = "http_target" // HTTPHostKey represents the value of the HTTP host header. HTTPHostKey = "http_host" // HTTPStatusCodeKey represents the HTTP response status code. HTTPStatusCodeKey = "http_status_code" // HTTPUserAgentKey represents the Value of the HTTP User-Agent header sent by the client. HTTPUserAgentKey = "http_user_agent" // HTTPClientIPKey represents the IP address of the original client behind all proxies, // if known (e.g. from X-Forwarded-For). HTTPClientIPKey = "http_client_ip" // HTTPRequestContentLengthKey represents the size of the request payload body in bytes. HTTPRequestContentLengthKey = "http_read_bytes" // HTTPWroteBytesKey represents the size of the response payload body in bytes. HTTPWroteBytesKey = "http_wrote_bytes" // #nosec // HTTPSchemeKey represents the URI scheme identifying the used protocol. HTTPSchemeKey = "http_scheme" // HTTPFlavorKey represents the Kind of HTTP protocol used. HTTPFlavorKey = "http_flavor" // HTTPRequestIDKey represents the HTTP request id if known (e.g. from X-Request-ID). HTTPRequestIDKey = "http_request_id" // HTTPSessionIDKey represents the HTTP session id if known (e.g. from X-Session-ID). HTTPSessionIDKey = "http_session_id" // HTTPTrackingIDKey represents the HTTP tracking id if known (e.g. from X-Tracking-ID). HTTPTrackingIDKey = "http_tracking_id" )
View Source
const ( MessagingSystemKey = "messaging_system" MessagingDestinationKey = "messaging_destination" MessagingDestinationKindKey = "messaging_destination_kind" MessagingProtocolKey = "messaging_protocol" MessagingProtocolVersionKey = "messaging_protocol_version" MessagingURLKey = "messaging_url" MessagingMessageIDKey = "messaging_message_id" MessagingConversationIDKey = "messaging_conversation_id" MessagingMessagePayloadSizeBytesKey = "messaging_message_payload_size_bytes" MessagingMessagePayloadCompressedSizeBytesKey = "messaging_message_payload_compressed_size_bytes" )
View Source
const ( // NetHostIPKey represents the local host IP. Useful in case of a multi-IP host. NetHostIPKey = "net_host_ip" // NetHostPortKey represents the local host port. NetHostPortKey = "net_host_port" )
View Source
const ( // ServiceNameKey represents the NameKey of the service. ServiceNameKey = "service_name" // ServiceMethodKey represents the Method of the service. ServiceMethodKey = "service_method" // ServiceNamespaceKey represents a namespace for `service.name`. This needs to // have meaning that helps to distinguish a group of services. For example, the // team name that owns a group of services. `service.name` is expected to be // unique within the same namespace. ServiceNamespaceKey = "service_namespace" // ServiceInstanceIDKey represents a unique identifier of the service instance. In conjunction // with the `service.name` and `service.namespace` this must be unique. ServiceInstanceIDKey = "service_instance.id" // ServiceVersionKey represents the version of the service API. ServiceVersionKey = "service_version" )
View Source
const ( StreamQueueKey = "queue" StreamSubjectKey = "subject" )
View Source
const ( ModeDev = "dev" ModeProd = "prod" )
View Source
const ( // PeerServiceKey represents the ServiceNameKey name of the remote service. // Should equal the actual `service.name` resource attribute of the remote service, if any. PeerServiceKey = "peer_service" )
View Source
const (
TraceID = "trace_id"
)
Variables ¶
This section is empty.
Functions ¶
func AtomicLevel ¶ added in v0.1.15
func AtomicLevel() zap.AtomicLevel
AtomicLevel return the configured atomic level
func FCodeInstance ¶ added in v0.10.0
func FCodeMethod ¶ added in v0.10.0
func FCodePackage ¶ added in v0.10.20
func FDurationFn ¶ added in v0.10.0
func FErrorType ¶
func FHTTPClientIP ¶
func FHTTPFlavor ¶
func FHTTPMethod ¶
func FHTTPRequestID ¶
func FHTTPScheme ¶
func FHTTPServerName ¶ added in v0.2.0
func FHTTPSessionID ¶ added in v0.2.0
func FHTTPStatusCode ¶
func FHTTPTarget ¶
func FHTTPTrackingID ¶ added in v0.11.3
func FHTTPUserAgent ¶
func FHTTPWroteBytes ¶
func FMessagingConversationID ¶ added in v0.2.0
func FMessagingDestination ¶ added in v0.2.0
func FMessagingDestinationKind ¶ added in v0.2.0
func FMessagingDestinationKind(value MessagingDestinationKind) zap.Field
func FMessagingMessageID ¶ added in v0.2.0
func FMessagingMessagePayloadCompressedSizeBytes ¶ added in v0.2.0
func FMessagingMessagePayloadSizeBytes ¶ added in v0.2.0
func FMessagingProtocol ¶ added in v0.2.0
func FMessagingProtocolVersion ¶ added in v0.2.0
func FMessagingSystem ¶ added in v0.2.0
func FMessagingURL ¶ added in v0.2.0
func FNetHostIP ¶
func FNetHostPort ¶
func FPeerService ¶
func FServiceInstanceID ¶
func FServiceMethod ¶
func FServiceName ¶
func FServiceNamespace ¶
func FServiceVersion ¶
func FStackSkip ¶
func FStreamQueue ¶ added in v0.5.0
func FStreamSubject ¶ added in v0.5.0
func IsDisableCaller ¶ added in v0.1.15
func IsDisableCaller() bool
IsDisableCaller returns the configured disabled caller value
func IsDisableStacktrace ¶ added in v0.1.15
func IsDisableStacktrace() bool
IsDisableStacktrace returns the configured disabled stacktrace value
func SetDisableCaller ¶ added in v0.1.15
SetDisableCaller sets the given value and re-configures the logger
func SetDisableStacktrace ¶ added in v0.1.15
SetDisableStacktrace sets the given value and re-configures the logger
func WithHTTPClientIP ¶ added in v0.11.6
func WithHTTPFlavor ¶ added in v0.11.6
func WithHTTPRequestID ¶ added in v0.11.6
func WithHTTPRequestOut ¶ added in v0.6.0
func WithHTTPScheme ¶ added in v0.11.6
func WithHTTPServerName ¶ added in v0.2.0
func WithHTTPSessionID ¶ added in v0.11.6
func WithHTTPTrackingID ¶ added in v0.11.6
Types ¶
type MessagingDestinationKind ¶ added in v0.2.0
type MessagingDestinationKind string
const ( MessagingDestinationKindQueue MessagingDestinationKind = "queue" MessagingDestinationKindTopic MessagingDestinationKind = "topic" )
Click to show internal directories.
Click to hide internal directories.