MukundaKatta opened a new pull request, #16124:
URL: https://github.com/apache/iceberg/pull/16124

   ### Summary
   
   The `iceberg-rest-fixture` Docker image uses `slf4j-simple` (the
   `testFixturesImplementation` binding in `build.gradle`) and ships with no
   logging configuration on the classpath. Two iceberg loggers fire on every
   REST API call and drown out warnings and errors:
   
   ```
   [qtp...] INFO  org.apache.iceberg.BaseMetastoreCatalog - Table loaded by 
catalog: ...
   [qtp...] INFO  org.apache.iceberg.BaseMetastoreTableOperations - 
Successfully committed to table ... in 12 ms
   [qtp...] INFO  org.apache.iceberg.BaseMetastoreTableOperations - Refreshing 
table metadata from new version: ...
   ```
   
   The user reported that `CATALOG_LOG4J_LOGLEVEL=WARN` had no effect — the
   runtime is `slf4j-simple`, not log4j, and the `CATALOG_*` prefix is for
   catalog config, so there was no override knob at all.
   
   ### Change
   
   Config-only:
   
   - Add `docker/iceberg-rest-fixture/simplelogger.properties` with the root
     level kept at `INFO` (so iceberg's own startup and lifecycle logs stay
     visible) and `BaseMetastoreCatalog` / `BaseMetastoreTableOperations`
     bumped to `WARN`. Includes a timestamp pattern.
   - `Dockerfile`: `COPY` the properties file to `/usr/lib/iceberg-rest/` and
     switch `CMD` from `java -jar iceberg-rest-adapter.jar` to
     `java -cp 
/usr/lib/iceberg-rest:/usr/lib/iceberg-rest/iceberg-rest-adapter.jar 
org.apache.iceberg.rest.RESTCatalogServer`
     so slf4j-simple picks up the file from the working directory. Main class
     is the same one already declared in the shadowJar manifest.
   - `README.md`: short Logging section showing how to override individual
     loggers via `-D` props or replace the file via a bind mount.
   
   No Java code changes. No build script changes. No new dependencies.
   
   ### How users override
   
   ```bash
   # bump to debug for everything
   docker run apache/iceberg-rest-fixture \
     java -Dorg.slf4j.simpleLogger.defaultLogLevel=debug \
          -cp 
/usr/lib/iceberg-rest:/usr/lib/iceberg-rest/iceberg-rest-adapter.jar \
          org.apache.iceberg.rest.RESTCatalogServer
   
   # replace the file entirely
   docker run -v 
/path/to/simplelogger.properties:/usr/lib/iceberg-rest/simplelogger.properties \
     apache/iceberg-rest-fixture
   ```
   
   ### Test plan
   
   - [ ] `./gradlew :iceberg-open-api:shadowJar`
   - [ ] `docker build -t apache/iceberg-rest-fixture -f 
docker/iceberg-rest-fixture/Dockerfile .`
   - [ ] Run image, hit `/v1/config` and `/v1/namespaces`, confirm the
         `BaseMetastoreCatalog` / `BaseMetastoreTableOperations` INFO lines
         no longer appear.
   - [ ] Run image with `-Dorg.slf4j.simpleLogger.defaultLogLevel=debug`
         override and confirm DEBUG lines appear.
   - [ ] Healthcheck still passes (it shells `curl`, not Java, so unaffected).
   
   I don't have docker available to run the build locally, so the rebuild and
   runtime verification above are pending. The change is mechanical (file +
   classpath) and the slf4j-simple property names are from the
   [upstream 
docs](https://www.slf4j.org/api/org/slf4j/simple/SimpleLogger.html).
   
   Closes #14227
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to