Documentation ¶
Index ¶
- Constants
- func Duration(key string, val time.Duration) zap.Field
- func Err(err error) zap.Field
- func EventAction(val string) zap.Field
- func EventCategory(val string) zap.Field
- func EventKind(val string) zap.Field
- func EventModule(val string) zap.Field
- func EventOriginal(val string) zap.Field
- func EventOutcome(val string) zap.Field
- func EventType(val string) zap.Field
- func HTTPRequestBodyContent(val string) zap.Field
- func HTTPRequestBodyHeaders(val []http.Header) zap.Field
- func HTTPRequestMethod(val string) zap.Field
- func HTTPRequestReferrer(val string) zap.Field
- func HTTPResponseBodyContent(val string) zap.Field
- func HTTPResponseBodyReferrer(val string) zap.Field
- func HTTPResponseStatusCode(val string) zap.Field
- func IsECSFieldName(fieldName string) bool
- func SanitizeHeaders(val []http.Header) []string
- func ServiceName(val string) zap.Field
- func Tags(val []string) zap.Field
- func TraceID(val string) zap.Field
Constants ¶
const ( // Internal base fields to be used by the logger FieldTimestamp = "@timestamp" FieldMessage = "message" FieldLabels = "labels" FieldTags = "tags" // Internal label fields to be used by the logger FieldLabelApplication = "application" FieldLabelService = "service" FieldLabelEnvironment = "environment" FieldLabelLibVersion = "lib_version" FieldLabelLibLanguage = "lib_language" FieldLabelPodName = "pod_name" FieldLabelNodeName = "node_name" FieldLogger = "log.logger" FieldLogLevel = "log.level" // Public fields to be available for consumers FieldServiceName = "service.name" FieldErrorMessage = "error.message" FieldStackTrace = "error.stack_trace" FieldErrorType = "error.type" FieldEventAction = "event.action" FieldEventKind = "event.kind" FieldEventCategory = "event.category" FieldEventModule = "event.module" FieldEventType = "event.type" FieldEventOriginal = "event.original" FieldEventOutcome = "event.outcome" FieldTraceID = "trace.id" FieldHTTPRequestBodyContent = "http.request.body.content" FieldHTTPRequestMethod = "http.request.method" FieldHTTPRequestBodyHeaders = "http.request.body.headers" FieldHTTPRequestReferrer = "http.request.referrer" FieldHTTPResponseBodyContent = "http.response.body.content" FieldHTTPResponseStatusCode = "http.response.status_code" FieldHTTPResponseBodyReferrer = "http.response.body.referrer" )
Encoding keys used for ECS compliance: https://www.elastic.co/guide/en/ecs/current/ecs-base.html
const ( LogPrefix = "log." LogBaseLevelKey = "log" HTTPPrefix = "http." HTTPBaseLevelKey = "http" EventPrefix = "event." EventBaseLevelKey = "event" ErrorPrefix = "error." ErrorBaseLevelKey = "error" TracePrefix = "trace." TraceBaseLevelKey = "trace" )
Variables ¶
This section is empty.
Functions ¶
func Err ¶
Err constructs an "error" field that carries an error. The returned Field will safely and explicitly represent `nil` when appropriate.
func EventAction ¶
EventAction constructs a String field with the FieldEventAction ECS standard key
func EventCategory ¶
EventCategory constructs a String field with the FieldEventCategory ECS standard key
func EventModule ¶
EventModule constructs a String field with the FieldEventModule ECS standard key
func EventOriginal ¶
EventOriginal constructs a String field with the FieldEventOriginal ECS standard key
func EventOutcome ¶
EventOutcome constructs a String field with the FieldEventOutcome ECS standard key
func HTTPRequestBodyContent ¶
HTTPRequestBodyContent constructs a String field with the FieldHTTPRequestBodyContent ECS standard key
func HTTPRequestBodyHeaders ¶
HTTPRequestBodyHeaders constructs a String field with the FieldHTTPRequestBodyHeaders ECS standard key
func HTTPRequestMethod ¶
HTTPRequestMethod constructs a String field with the FieldHTTPRequestMethod ECS standard key
func HTTPRequestReferrer ¶
HTTPRequestReferrer constructs a String field with the FieldHTTPRequestReferrer ECS standard key
func HTTPResponseBodyContent ¶
HTTPResponseBodyContent constructs a String field with the FieldHTTPResponseBodyContent ECS standard key
func HTTPResponseBodyReferrer ¶
HTTPResponseBodyReferrer constructs a String field with the FieldHTTPResponseBodyReferrer ECS standard key
func HTTPResponseStatusCode ¶
HTTPResponseStatusCode constructs a String field with the FieldHTTPResponseStatusCode ECS standard key
func IsECSFieldName ¶
func SanitizeHeaders ¶
func ServiceName ¶
ServiceName constructs a String field with the FieldServiceName ECS standard key
Types ¶
This section is empty.