Documentation ¶
Index ¶
- func Any(key string, val interface{}) zap.Field
- func Binary(key string, val []byte) zap.Field
- func Bool(key string, val bool) zap.Field
- func Bools(key string, val []bool) zap.Field
- func ByteString(key string, val []byte) zap.Field
- func ByteStrings(key string, val [][]byte) zap.Field
- func Duration(key string, val time.Duration) zap.Field
- func Durations(key string, val []time.Duration) zap.Field
- func Error(err error) zap.Field
- func Float32(key string, val float32) zap.Field
- func Float32s(key string, val []float32) zap.Field
- func Float64(key string, val float64) zap.Field
- func Float64s(key string, val []float64) zap.Field
- func HTTPRequest(req *http.Request) zapcore.Field
- func HTTPResponse(resp *http.Response) zapcore.Field
- func Int(key string, val int) zap.Field
- func Int64(key string, val int64) zap.Field
- func NamedError(key string, err error) zap.Field
- func Object(key string, val zapcore.ObjectMarshaler) zap.Field
- func Service(name string, version string) zapcore.Field
- func Source(ip string, port int) zapcore.Field
- func String(key string, val string) zap.Field
- func Strings(key string, val []string) zap.Field
- func Time(key string, val time.Time) zap.Field
- func Times(key string, val []time.Time) zap.Field
- func URL(url *url.URL) zapcore.Field
- func UserAgent(original string) zapcore.Field
- type HTTPRequestField
- type HTTPResponseField
- type ServiceField
- type SourceField
- type URLField
- type UserAgentField
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ByteString ¶ added in v1.1.0
ByteString is a wrappers of zap.ByteString.
func ByteStrings ¶ added in v1.1.0
ByteStrings is a wrappers of zap.ByteStrings.
func HTTPRequest ¶
HTTPRequest returns ECS http.request as zap.Field https://www.elastic.co/guide/en/ecs/current/ecs-http.html
func HTTPResponse ¶
HTTPResponse returns ECS http.response as zap.Field https://www.elastic.co/guide/en/ecs/current/ecs-http.html
func NamedError ¶ added in v1.1.0
NamedError is a wrappers of zap.NamedError.
func Object ¶ added in v1.1.0
func Object(key string, val zapcore.ObjectMarshaler) zap.Field
Object is a wrappers of zap.Object.
func Service ¶
Service returns ECS service as zap.Field https://www.elastic.co/guide/en/ecs/current/ecs-service.html
func Source ¶
Source returns ECS source as zap.Field https://www.elastic.co/guide/en/ecs/current/ecs-source.html
func URL ¶
URL returns ECS url as zap.Field https://www.elastic.co/guide/en/ecs/current/ecs-url.html
Types ¶
type HTTPRequestField ¶ added in v1.1.0
HTTPRequestField struct represents ECS http.request object https://www.elastic.co/guide/en/ecs/current/ecs-http.html
func (*HTTPRequestField) MarshalLogObject ¶ added in v1.1.0
func (r *HTTPRequestField) MarshalLogObject(enc zapcore.ObjectEncoder) error
MarshalLogObject implements zapcore ObjectMarshaler.
type HTTPResponseField ¶ added in v1.1.0
HTTPResponseField struct represents ECS http.response object https://www.elastic.co/guide/en/ecs/current/ecs-http.html
func (*HTTPResponseField) MarshalLogObject ¶ added in v1.1.0
func (r *HTTPResponseField) MarshalLogObject(enc zapcore.ObjectEncoder) error
MarshalLogObject implements zapcore ObjectMarshaler.
type ServiceField ¶ added in v1.1.0
ServiceField struct represents ECS service object https://www.elastic.co/guide/en/ecs/current/ecs-service.html
func (*ServiceField) MarshalLogObject ¶ added in v1.1.0
func (s *ServiceField) MarshalLogObject(enc zapcore.ObjectEncoder) error
MarshalLogObject implements zapcore ObjectMarshaler.
type SourceField ¶ added in v1.1.0
SourceField struct represents ECS source object https://www.elastic.co/guide/en/ecs/current/ecs-source.html
func (*SourceField) MarshalLogObject ¶ added in v1.1.0
func (s *SourceField) MarshalLogObject(enc zapcore.ObjectEncoder) error
MarshalLogObject implements zapcore ObjectMarshaler.
type URLField ¶ added in v1.1.0
URLField struct represents ECS url object https://www.elastic.co/guide/en/ecs/current/ecs-url.html
func (*URLField) MarshalLogObject ¶ added in v1.1.0
func (u *URLField) MarshalLogObject(enc zapcore.ObjectEncoder) error
MarshalLogObject implements zapcore ObjectMarshaler.
type UserAgentField ¶ added in v1.1.0
type UserAgentField struct {
Original string
}
UserAgentField struct represents ECS user_agent object https://www.elastic.co/guide/en/ecs/current/ecs-user_agent.html
func (*UserAgentField) MarshalLogObject ¶ added in v1.1.0
func (u *UserAgentField) MarshalLogObject(enc zapcore.ObjectEncoder) error
MarshalLogObject implements zapcore ObjectMarshaler.