Skip to content

Support httplog/v2 SourceFieldName #55

@VojtechVitek

Description

@VojtechVitek

Originally reported by @Yuan325 at #53.

	httpOpts = httplog.Options{
		JSON:             true,
		LogLevel:         logLevel,
		Concise:          true,
		RequestHeaders:   false,
		MessageFieldName: "message",
		SourceFieldName:  "logging.googleapis.com/sourceLocation",
		TimeFieldName:    "timestamp",
		LevelFieldName:   "severity",
	}

	httpLogger := httplog.NewLogger("httplog", httpOpts)
	r.Use(httplog.RequestLogger(httpLogger))

GCP: https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#logentrysourcelocation

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions