Add static registration configuration to access logs (#166)

To enable access logs to be statically registered in Envoy, a name and custom configuration struct will have to be provided.
pull/169/head
Matt Rice 8 years ago committed by htuch
parent 9e775ee709
commit 2ece56b705
  1. 6
      api/BUILD
  2. 55
      api/filter/http_connection_manager.proto

@ -2,12 +2,6 @@ load("//bazel:api_build_system.bzl", "api_proto_library")
licenses(["notice"]) # Apache 2 licenses(["notice"]) # Apache 2
api_proto_library(
name = "accesslog",
srcs = ["accesslog.proto"],
deps = [":base"],
)
api_proto_library( api_proto_library(
name = "address", name = "address",
srcs = ["address.proto"], srcs = ["address.proto"],

@ -91,45 +91,12 @@ message AccessLogFilter {
} }
} }
// Extra headers to include when doing AccessLogs via proto format. // Custom configuration for an AccessLog that writes log entries directly to a file.
message HeaderSelection { // Configures the built-in "envoy.file_access_log" AccessLog.
// Request headers to include in the AccessLog. message FileAccessLog {
repeated string request_headers = 1; // A path to a local file to which to write the access log entries.
// Response headers to include in the AccessLog.
repeated string response_headers = 2;
}
message AccessLog {
// Destination location the access log is written to.
//
// Envoy supports logging to both RPC endpoints and local disk files.
// Behavior is set by choosing which of these is used:
oneof destination {
// A path to a local file
string path = 1; string path = 1;
// The name of an upstream cluster that hosts RPC endpoints for the
// AccessLog sink. The cluster must provide an endpoint capable of
// receiving the AccessLog API. The exact flavor of API spoken will
// depend on the statically registered log interface module specified
// in Envoy's startup configuration.
string cluster = 5;
}
// Content included in log entries.
//
// When logging to a file this is a format string which specifies what is
// included.
//
// When logging to an RPC endpoint all of the named fields in accesslog.proto
// are populated by default if the relevant data is available for the logged
// request. Additional headers desired for logging can be specified in the
// HeaderSelection.
oneof content {
// Access log format for file logging.
//
// Envoy supports custom access log formats as well as a
// default format.
//
// [V2-API-DIFF] In addition to the existing format specifiers, the following // [V2-API-DIFF] In addition to the existing format specifiers, the following
// additional specifiers will be available: // additional specifiers will be available:
// %TLS_SNI_HOSTNAME%: SNI from handshake. // %TLS_SNI_HOSTNAME%: SNI from handshake.
@ -141,13 +108,19 @@ message AccessLog {
// TODO(htuch): Document how envoy.http_connection_manager.access_log values // TODO(htuch): Document how envoy.http_connection_manager.access_log values
// can be accessed in the format specifier. // can be accessed in the format specifier.
string format = 2; string format = 2;
}
// Extra headers to include when RPC logging. message AccessLog {
HeaderSelection headers = 4; // The name of the access log implementation to instantiate. The name must
} // match a statically registered access log.
string name = 1;
// Filter which is used to determine if the access log needs to be written. // Filter which is used to determine if the access log needs to be written.
AccessLogFilter filter = 3; AccessLogFilter filter = 2;
// Custom configuration that depends on the access log being instantiated.
// See the supported AccessLogs for further documentation.
google.protobuf.Struct config = 3;
} }
message HttpFilter { message HttpFilter {

Loading…
Cancel
Save