You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by "rustyrazorblade (via GitHub)" <gi...@apache.org> on 2026/08/29 00:47:12 UTC

[PR] CASSSIDECAR-496: Make Netty wire logging configurable and disabled by default [cassandra-sidecar]

rustyrazorblade opened a new pull request, #381:
URL: https://github.com/apache/cassandra-sidecar/pull/381

   [CASSSIDECAR-496](https://issues.apache.org/jira/browse/CASSSIDECAR-496)
   
   `HttpServerOptionsProvider` line 58 hardcodes `setLogActivity(true)`, installing Netty's `LoggingHandler` on every HTTP connection with no way to disable it — the only hardcoded option in a method where everything else reads from `SidecarConfiguration`.
   
   On a 3-node cluster running the `ghcr.io/apache/cassandra-sidecar` image this produced **8.6 million log lines in one hour**, roughly 96% of all log volume in the cluster (the next largest stream was 357k), because `ByteBufUtil.appendPrettyHexDump` turns a single 95,504-byte response into about 6,000 lines.
   
   The dumps contain request and response bodies in cleartext. Since schema endpoints return DDL in their response bodies, CQL statements are written to the logs as well:
   
   ```
   |00016260| 66 61 63 74 6f 72 27 3a 20 27 31 27 20 7d 20 41 |factor': '1' } A|
   |00016270| 4e 44 20 44 55 52 41 42 4c 45 5f 57 52 49 54 45 |ND DURABLE_WRITE|
   |00016280| 53 20 3d 20 74 72 75 65 3b 5c 6e 5c 6e 43 52 45 |S = true;\n\nCRE|
   ```
   
   Operators collecting container stdout are shipping request payloads to their log store without opting in.
   
   It only fires when the process starts without `logback.configurationFile`, which is supplied solely by the Gradle-generated start scripts. A directly launched jar gets no logback configuration and falls back to logback's default of root DEBUG to ConsoleAppender — the common container path. A Sidecar started via the start script does not show this, since the shipped `conf/logback.xml` sets `<root level="INFO">`. The test suite could not catch it either: `server/src/test/resources/logback-test.xml` pins `LoggingHandler` to info.
   
   ## Changes
   
   - New `log_activity` service option, defaulting to `false`, following the existing `tcp_keep_alive` pattern in `ServiceConfigurationImpl`
   - `HttpServerOptionsProvider` reads it from `serviceConf` instead of hardcoding `true`
   - Explicit `<logger name="io.netty" level="INFO"/>` in `conf/logback.xml` as defence in depth
   - Documented in `conf/sidecar.yaml` and `docs/src/user.adoc`, matching how sibling options are listed
   - Corrects the `SIDECAR_DEBUG` appender comment, which claimed "all levels" while carrying an INFO `ThresholdFilter` under a root logger set to INFO, so `debug.log` has always duplicated `system.log`. Lowering the filter alone would be a no-op — a `ThresholdFilter` can only subtract from what the logger level admits — so making `debug.log` carry DEBUG requires a root-level change and belongs in its own ticket.
   
   ## Testing
   
   New `HttpServerOptionsProviderTest` (4 tests: default false, explicit true, explicit false, and the existing option chain still flows through). `SidecarConfigurationTest` extended with default and explicit-read cases.
   
   73 tests across 6 classes, 0 failures. Checkstyle clean on all touched files.
   
   `:server:test` was run with `-x checkEnvironment`, which requires loopback aliases `127.0.0.2-127.0.0.20` unavailable on the development machine. None of the exercised classes bind those aliases; CI covers the remainder.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Re: [PR] CASSSIDECAR-496: Disable Netty wire logging on the HTTP server [cassandra-sidecar]

Posted by "yifan-c (via GitHub)" <gi...@apache.org>.
yifan-c merged PR #381:
URL: https://github.com/apache/cassandra-sidecar/pull/381


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org