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

Envoy Logs are on in json format and Logviewer identified them as error #33640

Closed
lijie123bes opened this issue Apr 18, 2024 · 3 comments
Closed
Labels
area/envoy_log question Questions that are neither investigations, bugs, nor enhancements stale stalebot believes this issue/PR has not been touched recently

Comments

@lijie123bes
Copy link

I am very much new to envoy. I am trying to print the envoy container logs in json format and print them in console.

Below is my configuration but it seems to make no difference

admin:
  access_log:
    - name: envoy.access_loggers.stdout
      typed_config:
        "@type": type.googleapis.com/envoy.extensions.access_loggers.stream.v3.StdoutAccessLog
        log_format:
          json_format:
            start_time: "%START_TIME%"
            status: "%RESPONSE_CODE%"
            server_protocol: "%PROTOCOL%"
            request_method: "%REQ(:METHOD)%"
            request_uri: "%REQ(X-ENVOY-ORIGINAL-PATH?:PATH)%"
            response_flags: "%RESPONSE_FLAGS%"
            request_length: "%BYTES_RECEIVED%"
            bytes_sent: "%BYTES_SENT%"
            request_time: "%DURATION%"
            upstream_response_time: "%RESP(X-ENVOY-UPSTREAM-SERVICE-TIME)%"
            http_x_forwarded_for: "%REQ(X-FORWARDED-FOR)%"
            http_user_agent: "%REQ(USER-AGENT)%"
            request_id: "%REQ(X-REQUEST-ID)%"
            request_authority: "%REQ(:AUTHORITY)%"
            upstream: "%UPSTREAM_HOST%"
....
....
static_resources:
  listeners:
  - name: listener_0
    address:
      socket_address: { protocol: TCP, address: 0.0.0.0, port_value: 8000 }
    # -----PROXY protocol configurations-----
    listener_filters:
    - name: envoy.filters.listener.proxy_protocol
      typed_config:
        "@type": type.googleapis.com/envoy.extensions.filters.listener.proxy_protocol.v3.ProxyProtocol
    # -----PROXY protocol configurations-----
    filter_chains:
    - filters:
      - name: envoy.filters.network.http_connection_manager
        typed_config:
          "@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
          access_log:
            - name: envoy.access_loggers.stdout
              typed_config:
                "@type": type.googleapis.com/envoy.extensions.access_loggers.stream.v3.StdoutAccessLog
                log_format:
                  json_format:
                    start_time: "%START_TIME%"
                    status: "%RESPONSE_CODE%"
                    server_protocol: "%PROTOCOL%"
                    request_method: "%REQ(:METHOD)%"
                    request_uri: "%REQ(X-ENVOY-ORIGINAL-PATH?:PATH)%"
                    response_flags: "%RESPONSE_FLAGS%"
                    request_length: "%BYTES_RECEIVED%"
                    bytes_sent: "%BYTES_SENT%"
                    request_time: "%DURATION%"
                    upstream_response_time: "%RESP(X-ENVOY-UPSTREAM-SERVICE-TIME)%"
                    http_x_forwarded_for: "%REQ(X-FORWARDED-FOR)%"
                    http_user_agent: "%REQ(USER-AGENT)%"
                    request_id: "%REQ(X-REQUEST-ID)%"
                    request_authority: "%REQ(:AUTHORITY)%"
                    upstream: "%UPSTREAM_HOST%"

And the envoy logs are still in plain text When the logs are pushed to gcp cloud logging, they are identified as erors Podlogs:

[2024-04-03 08:03:12.802][1][info][main] [source/server/server.cc:849] all clusters initialized. initializing init manager
[2024-04-03 08:03:12.802][1][info][config] [source/server/listener_manager_impl.cc:784] all dependencies initialized. starting workers
[2024-04-03 08:03:12.807][1][warning][main] [source/server/server.cc:747] there is no configured limit to the number of allowed active connections. Set a limit via the runtime key overload.global_downstream_max_connections

@lijie123bes lijie123bes added bug triage Issue requires triage labels Apr 18, 2024
@adisuissa
Copy link
Contributor

I think you are configuring the access-logs and not the application (Envoy) logs.
See https://www.envoyproxy.io/docs/envoy/v1.30.1/configuration/observability/application_logging.html#printing-logs-in-json-format for more details on how to configure the Envoy logs.

@adisuissa adisuissa added question Questions that are neither investigations, bugs, nor enhancements area/envoy_log and removed bug triage Issue requires triage labels Apr 19, 2024
Copy link

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale stalebot believes this issue/PR has not been touched recently label May 19, 2024
Copy link

This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted" or "no stalebot". Thank you for your contributions.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/envoy_log question Questions that are neither investigations, bugs, nor enhancements stale stalebot believes this issue/PR has not been touched recently
Projects
None yet
Development

No branches or pull requests

2 participants