Skip to content

Missing new line between JSON access log entries #5018

@GregHanson

Description

@GregHanson

Missing new line between JSON access log entries

Description:

PR #4693 introduced JSON access logging. When implemented, there is no new line separating entries in the access log. The logs appear to be one right after the other with no separating new lines.

Config:
Sample Listener config:

     "version_info": "2018-11-12T18:15:14Z/19",
     "listener": {
      "name": "172.17.0.21_15020",
      "address": {
       "socket_address": {
        "address": "172.17.0.21",
        "port_value": 15020
       }
      },
      "filter_chains": [
       {
        "filters": [
         {
          "name": "envoy.tcp_proxy",
          "config": {
           "access_log": [
            {
             "name": "envoy.file_access_log",
             "config": {
              "json_format": {
               "downstream_remote_address": "%DOWNSTREAM_REMOTE_ADDRESS%",
               "path": "%REQ(X-ENVOY-ORIGINAL-PATH?:PATH)%",
               "authority": "%REQ(:AUTHORITY)%",
               "protocol": "%PROTOCOL%",
               "upstream_service_time": "%RESP(X-ENVOY-UPSTREAM-SERVICE-TIME)%",
               "upstream_local_address": "%UPSTREAM_LOCAL_ADDRESS%",
               "duration": "%DURATION%",
               "downstream_local_address": "%DOWNSTREAM_LOCAL_ADDRESS%",
               "user_agent": "%REQ(USER-AGENT)%",
               "response_code": "%RESPONSE_CODE%",
               "response_flags": "%RESPONSE_FLAGS%",
               "start_time": "%START_TIME%",
               "method": "%START_TIME%",
               "request_id": "%REQ(X-REQUEST-ID)%",
               "upstream_host": "%UPSTREAM_HOST%",
               "x_forwarded_for": "%REQ(X-FORWARDED-FOR)%",
               "requested_server_name": "%REQUESTED_SERVER_NAME%",
               "bytes_received": "%BYTES_RECEIVED%",
               "bytes_sent": "%BYTES_SENT%",
               "upstream_cluster": "%UPSTREAM_CLUSTER%"
              },
              "path": "/dev/stdout"
             }
            }
           ],
           "stat_prefix": "inbound|15020||mgmtCluster",
           "cluster": "inbound|15020||mgmtCluster"
          }
         }
        ]
       }
      ],
      "deprecated_v1": {
       "bind_to_port": false
      }
     },
     "last_updated": "2018-11-12T18:15:24.023Z"
    },

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions