Configuration: consul agent with envoy side-car proxy, configured using escape hatch. I’ve specified access logs to files for two listeners (grpc and http), but no files were created.
I also tried to create it manually and start side-car as consul connect envoy -sidecar-for ApiGateway -- -l debug --log-path /var/log/envoy.txt
. In this case log has some logs from connection,filter,pool and main components, but nothing looks like access logs.
What is wrong?
Thanks!
My consul config:
addresses = {
http = "0.0.0.0"
}
bootstrap = true
connect = {
enabled = true
}
ui_config = {
enabled = true
}
node_name = "ApiGateway"
retry_join = ["TestDevicesWebApi","IdentityApi"]
server = true
"ports" = {
"grpc" = 8502
}
service = {
name = "ApiGateway"
port = 80
tags = ["apigateway"]
connect = {
sidecar_service = {
port = 21000
proxy = {
upstreams = [
{
destination_name = "TestDevicesWebApi"
local_bind_port = 5001
config {
envoy_extra_static_clusters_json = <<EOL
{
"@type": "type.googleapis.com/envoy.config.cluster.v3.Cluster",
"name": "TestDevicesWebApi",
"type": "EDS",
"eds_cluster_config": {
"eds_config": {
"ads": {}
}
},
"connect_timeout": "5s",
"http2_protocol_options": {}
}
EOL
envoy_extra_static_listeners_json = <<EOL
{
"@type": "type.googleapis.com/envoy.config.listener.v3.Listener",
"name": "TestDevicesWebApi",
"address": {
"socketAddress": {
"address": "127.0.0.1",
"portValue": 5001
}
},
"filterChains": [
{
"filters": [
{
"name": "envoy.filters.network.http_connection_manager",
"typedConfig": {
"@type": "type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager",
"stat_prefix": "TestDevicesWebApi",
"access_log":
{
"name": "envoy.access_loggers.file",
"typedConfig": {
"@type": "type.googleapis.com/envoy.extensions.access_loggers.file.v3.FileAccessLog",
"path": "/var/log/envoy.txt"
}
},
"http_filters": [
{
"name": "envoy.filters.http.grpc_web",
"typedConfig":
{
"@type": "type.googleapis.com/envoy.extensions.filters.http.grpc_web.v3.GrpcWeb"
},
"name": "envoy.filters.http.router",
"typedConfig":
{
"@type": "type.googleapis.com/envoy.extensions.filters.http.router.v3.Router"
}
}
],
"route_config": {
"name": "local_route",
"virtual_hosts": [
{
"name": "TestDevicesWebApi",
"domains": ["*"],
"routes": [
{
"match": {
"prefix": "/api/v1/"
},
"route": {
"cluster": "TestDevicesWebApi"
}
}
]
}
]
}
}
}
]
}
]
}
EOL
}
},
{
destination_name = "IdentityApi"
local_bind_port = 5054
config {
envoy_extra_static_clusters_json = <<EOL
{
"@type": "type.googleapis.com/envoy.config.cluster.v3.Cluster",
"name": "IdentityApi",
"type": "EDS",
"eds_cluster_config": {
"eds_config": {
"ads": {}
}
},
"connect_timeout": "5s"
}
EOL
envoy_extra_static_listeners_json = <<EOL
{
"@type": "type.googleapis.com/envoy.config.listener.v3.Listener",
"name": "IdentityApi",
"address": {
"socketAddress": {
"address": "127.0.0.1",
"portValue": 5054
}
},
"filterChains": [
{
"filters": [
{
"name": "envoy.filters.network.http_connection_manager",
"typedConfig": {
"@type": "type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager",
"stat_prefix": "IdentityApi",
"access_log":
{
"name": "envoy.file_access_log",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.access_loggers.file.v3.FileAccessLog",
"path": "/var/log/envoy.txt"
}
}
"http_filters": [
{
"name": "envoy.filters.http.router",
"typedConfig":
{
"@type": "type.googleapis.com/envoy.extensions.filters.http.router.v3.Router"
}
}
],
"route_config": {
"name": "local_route",
"virtual_hosts": [
{
"name": "IdentityApi",
"domains": ["*"],
"routes": [
{
"match": {
"prefix": "/"
},
"route": {
"cluster": "IdentityApi"
}
}
]
}
]
}
}
}
]
}
]
}
EOL
}
}
]
}
}
}
}