Documentation ¶
Index ¶
- Constants
- func AtomicLevel() zap.AtomicLevel
- func FDuration(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 FHTTPStatusCode(status int) zap.Field
- func FHTTPTarget(target string) zap.Field
- func FHTTPUserAgent(userAgent string) zap.Field
- func FHTTPWroteBytes(bytes int64) 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 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, msg string)
- func SetDisableCaller(value bool) error
- func SetDisableStacktrace(value bool) error
- func WithError(l *zap.Logger, err error) *zap.Logger
- func WithHTTPRequest(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
Constants ¶
View Source
const ( NumKey = "num" NameKey = "name" DurationKey = "duration" // ValueKey represents a generic value attribute. ValueKey = "value" )
View Source
const ( ErrorTypeKey = "error_type" ErrorMessageKey = "error_message" ErrorStacktraceKey = "error_stacktrace" )
View Source
const ( // 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" // 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" )
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 ( 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 FErrorType ¶
func FHTTPClientIP ¶
func FHTTPFlavor ¶
func FHTTPMethod ¶
func FHTTPRequestID ¶
func FHTTPScheme ¶
func FHTTPStatusCode ¶
func FHTTPTarget ¶
func FHTTPUserAgent ¶
func FHTTPWroteBytes ¶
func FNetHostIP ¶
func FNetHostPort ¶
func FPeerService ¶
func FServiceInstanceID ¶
func FServiceMethod ¶
func FServiceName ¶
func FServiceNamespace ¶
func FServiceVersion ¶
func FStackSkip ¶
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
Types ¶
Click to show internal directories.
Click to hide internal directories.