Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing new line between JSON access log entries #5018

Closed
GregHanson opened this issue Nov 12, 2018 · 3 comments
Closed

Missing new line between JSON access log entries #5018

GregHanson opened this issue Nov 12, 2018 · 3 comments
Labels
Milestone

Comments

@GregHanson
Copy link
Contributor

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"
    },
@GregHanson
Copy link
Contributor Author

cc @aa-stripe

@aa-stripe
Copy link
Contributor

Thanks for reporting this! I'll take a look

@aa-stripe
Copy link
Contributor

This is indeed the case, can't believe I missed this, me--. Working on a patch now!

@mattklein123 mattklein123 added this to the 1.9.0 milestone Nov 13, 2018
htuch pushed a commit that referenced this issue Nov 14, 2018
Tack a newline onto the end of all JSON access log lines

Risk Level: Low
Testing: Every JSON unit test will now check to see that there is one (and only one) newline in a log line
Docs Changes: None
Release Notes: None

Fixes #5018

Signed-off-by: Aaltan Ahmad <[email protected]>
fredlas pushed a commit to fredlas/envoy that referenced this issue Mar 5, 2019
Tack a newline onto the end of all JSON access log lines

Risk Level: Low
Testing: Every JSON unit test will now check to see that there is one (and only one) newline in a log line
Docs Changes: None
Release Notes: None

Fixes envoyproxy#5018

Signed-off-by: Aaltan Ahmad <[email protected]>
Signed-off-by: Fred Douglas <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants