tonic icon indicating copy to clipboard operation
tonic copied to clipboard

Unwanted logs after applying tower middleware

Open sangnnc opened this issue 3 years ago • 2 comments

Bug Report

  • After following the instructions at https://github.com/hyperium/tonic/blob/master/examples/src/tower/server.rs to add middleware to my service, everything works fine except that there are unwanted logs appearing.

    • 2022-08-30T08:20:42.614509+07:00 DEBUG h2::codec::framed_write - send frame=Settings { flags: (0x0), initial_window_size: 1048576, max_frame_size: 16384, max_header_list_size: 16777216 }
    • 2022-08-30T08:20:42.615164+07:00 DEBUG h2::proto::connection - Connection; peer=Server
    • 2022-08-30T08:20:42.615391+07:00 DEBUG h2::codec::framed_read - received frame=Settings { flags: (0x0), enable_push: 0, initial_window_size: 65535 }
    • 2022-08-30T08:20:42.615461+07:00 DEBUG h2::codec::framed_write - send frame=Settings { flags: (0x1: ACK) }
    • 2022-08-30T08:20:42.615524+07:00 DEBUG h2::codec::framed_read - received frame=WindowUpdate { stream_id: StreamId(0), size_increment: 67043329 }
    • 2022-08-30T08:20:42.615801+07:00 DEBUG h2::codec::framed_read - received frame=Headers { stream_id: - StreamId(1), flags: (0x4: END_HEADERS) }
    • 2022-08-30T08:20:42.616069+07:00 DEBUG h2::codec::framed_read - received frame=Data { stream_id: StreamId(1) }
    • 2022-08-30T08:20:42.616169+07:00 DEBUG h2::codec::framed_read - received frame=Data { stream_id: StreamId(1), flags: (0x1: END_STREAM) }
    • 2022-08-30T08:20:42.616234+07:00 DEBUG h2::codec::framed_read - received frame=Settings { flags: (0x1: ACK) }
    • 2022-08-30T08:20:42.616275+07:00 DEBUG h2::proto::settings - received settings ACK; applying Settings { flags: (0x0), initial_window_size: 1048576, max_frame_size: 16384, max_header_list_size: 16777216 }
    • 2022-08-30T08:20:42.616369+07:00 DEBUG h2::codec::framed_write - send frame=WindowUpdate { stream_id: StreamId(0), size_increment: 983041 }

I really do not know where the logs come from. It appears to me that the logs show details of the gRPC requests and responses.

Version

tower = "0.4.13" futures = "0.3.24" tokio = { version = "1.20.1", features = [ "rt-multi-thread", "time", "fs", "macros", "net",] } tonic = "0.8" hyper = "0.14.20" tower-service = "0.3.2"

Platform

macOS

sangnnc avatar Aug 30 '22 01:08 sangnnc

How are you filtering your logs? These are just the h2 debug logs used by the http2 implementation tonic is using.

LucioFranco avatar Aug 30 '22 14:08 LucioFranco

@LucioFranco thanks you for the response. Let me filter the logs.

sangnnc avatar Aug 30 '22 22:08 sangnnc