Skip to content

Conversation

@wForget
Copy link
Member

@wForget wForget commented Sep 11, 2025

Which issue does this PR close?

Closes #2309

Rationale for this change

Makes it easier for us to modify the native log level

What changes are included in this PR?

Add COMET_LOG_LEVEL env to allow specifying native log level

How are these changes tested?

Adding COMET_LOG_LEVEL=DEBUG overrides default log level:
image

@codecov-commenter
Copy link

codecov-commenter commented Sep 11, 2025

Codecov Report

❌ Patch coverage is 62.50000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.44%. Comparing base (f09f8af) to head (597b362).
⚠️ Report is 501 commits behind head on main.

Files with missing lines Patch % Lines
...mon/src/main/java/org/apache/comet/NativeBase.java 40.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2379      +/-   ##
============================================
+ Coverage     56.12%   57.44%   +1.31%     
- Complexity      976     1297     +321     
============================================
  Files           119      147      +28     
  Lines         11743    13424    +1681     
  Branches       2251     2351     +100     
============================================
+ Hits           6591     7711    +1120     
- Misses         4012     4451     +439     
- Partials       1140     1262     +122     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@andygrove
Copy link
Member

@wForget Could you a note to the debugging guide?

@wForget
Copy link
Member Author

wForget commented Sep 11, 2025

@wForget Could you a note to the debugging guide?

Sure. Also, can I change these log properties to environments? It seems easier to configure them in spark using something like like spark.executorEnv.XXX?

@wForget
Copy link
Member Author

wForget commented Sep 15, 2025

Also, can I change these log properties to environments? It seems easier to configure them in spark using something like like spark.executorEnv.XXX?

Previously, the COMET_CONF_DIR environment variable was used to specify the log configuration file dir. I added a COMET_LOG_LEVEL environment variable to specify the log level.

@wForget
Copy link
Member Author

wForget commented Sep 15, 2025

@andygrove Could you please take another look? I added the document.

LOG.info(
"Couldn't locate log file from either COMET_CONF_DIR or comet.log.file.path. "
+ "Using default log configuration which emits to stdout");
+ "Using default log configuration with {} log level which emits to stderr",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected to emits to stderr

.target(Target::Stderr)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why change to stderr? Shouldn't the default log level should be info, emitting to stdout?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why change to stderr? Shouldn't the default log level should be info, emitting to stdout?

This is just a log fix, the behavior change was introduced by #164

Copy link
Contributor

@comphead comphead left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks @wForget

Copy link
Member

@andygrove andygrove left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @wForget

@andygrove andygrove merged commit b27aa03 into apache:main Sep 17, 2025
96 checks passed
coderfender pushed a commit to coderfender/datafusion-comet that referenced this pull request Dec 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Write documentation about enabling native logging via log4rs and COMET_CONF_DIR

5 participants