Skip to content

Strip $ suffix from logger names of Scala companion objects - #818

Merged
yruslan merged 1 commit into
mainfrom
feature/tidy-up-logs
Oct 14, 2026
Merged

yruslan merged 1 commit into
mainfrom
feature/tidy-up-logs

Conversation

@yruslan

@yruslan yruslan commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator
  • Import LoggerFactory explicitly in schedule strategy classes
  • Add log4j2.discardThreshold to the list of keys not to be printed, since its value (usually ERROR) confuses log error scanners

Overview

Release Notes

  • Use this.getClass.getName.stripSuffix("$") for loggers in Scala objects so log names match class names

Related

--

Summary by CodeRabbit

  • Bug Fixes
    • Improved application log naming by removing internal Scala object suffixes, making log entries clearer and more consistent.
    • Added the logging discard threshold setting to the list of configuration keys that are redacted.

- Use `this.getClass.getName.stripSuffix("$")` for loggers in Scala objects so log names match class names
- Import `LoggerFactory` explicitly in schedule strategy classes
- Add `log4j2.discardThreshold` to the list of keys not to be printed, since its value (usually `ERROR`) confuses log error scanners
@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fce78d44-e8fd-43bb-a946-9bbfb89b81ac
📥 Commits

Reviewing files that changed from the base of the PR and between 76306dc and d64d970.

📒 Files selected for processing: 52
  • pramen/core/src/main/scala/za/co/absa/pramen/core/RunnerCommons.scala
  • pramen/core/src/main/scala/za/co/absa/pramen/core/app/config/BookkeeperConfig.scala
  • pramen/core/src/main/scala/za/co/absa/pramen/core/app/config/HookConfig.scala
  • pramen/core/src/main/scala/za/co/absa/pramen/core/app/config/RuntimeConfig.scala
  • pramen/core/src/main/scala/za/co/absa/pramen/core/bookkeeper/Bookkeeper.scala
  • pramen/core/src/main/scala/za/co/absa/pramen/core/bookkeeper/BookkeeperDynamoDb.scala
  • pramen/core/src/main/scala/za/co/absa/pramen/core/config/Keys.scala
  • pramen/core/src/main/scala/za/co/absa/pramen/core/lock/TokenLockRegistry.scala
  • pramen/core/src/main/scala/za/co/absa/pramen/core/metastore/MetastoreImpl.scala
  • pramen/core/src/main/scala/za/co/absa/pramen/core/metastore/model/MetaTable.scala
  • pramen/core/src/main/scala/za/co/absa/pramen/core/metastore/peristence/MetastorePersistenceIceberg.scala
  • pramen/core/src/main/scala/za/co/absa/pramen/core/metastore/peristence/MetastorePersistenceRaw.scala
  • pramen/core/src/main/scala/za/co/absa/pramen/core/metastore/peristence/TransientTableManager.scala
  • pramen/core/src/main/scala/za/co/absa/pramen/core/pipeline/OperationDef.scala
  • pramen/core/src/main/scala/za/co/absa/pramen/core/pipeline/OperationSplitter.scala
  • pramen/core/src/main/scala/za/co/absa/pramen/core/pipeline/SinkTableParser.scala
  • pramen/core/src/main/scala/za/co/absa/pramen/core/pipeline/SourceTableParser.scala
  • pramen/core/src/main/scala/za/co/absa/pramen/core/pipeline/TransferTableParser.scala
  • pramen/core/src/main/scala/za/co/absa/pramen/core/rdb/PramenDb.scala
  • pramen/core/src/main/scala/za/co/absa/pramen/core/reader/model/TableReaderJdbcConfig.scala
  • pramen/core/src/main/scala/za/co/absa/pramen/core/runner/AppRunner.scala
  • pramen/core/src/main/scala/za/co/absa/pramen/core/runner/PipelineSparkSessionBuilder.scala
  • pramen/core/src/main/scala/za/co/absa/pramen/core/runner/splitter/ScheduleStrategyIncremental.scala
  • pramen/core/src/main/scala/za/co/absa/pramen/core/runner/splitter/ScheduleStrategySourcing.scala
  • pramen/core/src/main/scala/za/co/absa/pramen/core/runner/splitter/ScheduleStrategyUtils.scala
  • pramen/core/src/main/scala/za/co/absa/pramen/core/runner/task/ThreadClosableRegistry.scala
  • pramen/core/src/main/scala/za/co/absa/pramen/core/sink/SparkSink.scala
  • pramen/core/src/main/scala/za/co/absa/pramen/core/source/RawFileSource.scala
  • pramen/core/src/main/scala/za/co/absa/pramen/core/source/SparkSource.scala
  • pramen/core/src/main/scala/za/co/absa/pramen/core/sql/SqlGeneratorDatabricks.scala
  • pramen/core/src/main/scala/za/co/absa/pramen/core/sql/SqlGeneratorDenodo.scala
  • pramen/core/src/main/scala/za/co/absa/pramen/core/sql/SqlGeneratorHive.scala
  • pramen/core/src/main/scala/za/co/absa/pramen/core/sql/SqlGeneratorLoader.scala
  • pramen/core/src/main/scala/za/co/absa/pramen/core/sql/SqlGeneratorSas.scala
  • pramen/core/src/main/scala/za/co/absa/pramen/core/utils/ConfigUtils.scala
  • pramen/core/src/main/scala/za/co/absa/pramen/core/utils/JdbcNativeUtils.scala
  • pramen/core/src/main/scala/za/co/absa/pramen/core/utils/JdbcSparkUtils.scala
  • pramen/core/src/main/scala/za/co/absa/pramen/core/utils/ScheduleUtils.scala
  • pramen/core/src/main/scala/za/co/absa/pramen/core/utils/SparkUtils.scala
  • pramen/core/src/main/scala/za/co/absa/pramen/core/utils/ThreadUtils.scala
  • pramen/core/src/main/scala/za/co/absa/pramen/core/utils/TimeUtils.scala
  • pramen/core/src/main/scala/za/co/absa/pramen/core/utils/hive/HiveHelper.scala
  • pramen/core/src/main/scala/za/co/absa/pramen/runner/PipelineRunner.scala
  • pramen/core/src/main/scala_2.12/za/co/absa/pramen/core/metastore/peristence/MetastorePersistenceIcebergOps.scala
  • pramen/core/src/main/scala_2.13/za/co/absa/pramen/core/metastore/peristence/MetastorePersistenceIcebergOps.scala
  • pramen/core/src/test/scala/za/co/absa/pramen/core/mocks/dao/MongoDbSingleton.scala
  • pramen/extras/src/main/scala/za/co/absa/pramen/extras/infofile/InfoFileGeneration.scala
  • pramen/extras/src/main/scala/za/co/absa/pramen/extras/notification/EcsNotificationTarget.scala
  • pramen/extras/src/main/scala/za/co/absa/pramen/extras/sink/StandardizationSink.scala
  • pramen/extras/src/main/scala/za/co/absa/pramen/extras/utils/ConfigUtils.scala
  • pramen/extras/src/main/scala/za/co/absa/pramen/extras/utils/httpclient/SimpleHttpClient.scala
  • pramen/extras/src/main/scala/za/co/absa/pramen/extras/writer/TableWriterKafka.scala

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

Logger initialization now uses class-name strings with a trailing Scala object $ removed across core and extras components. The configuration redaction set also adds log4j2.discardThreshold.

Changes

Logger Name Normalization

Layer / File(s) Summary
Runtime and scheduling loggers
pramen/core/src/main/scala/za/co/absa/pramen/core/RunnerCommons.scala, pramen/core/src/main/scala/za/co/absa/pramen/core/app/config/*.scala, pramen/core/src/main/scala/za/co/absa/pramen/core/bookkeeper/*.scala, pramen/core/src/main/scala/za/co/absa/pramen/core/lock/TokenLockRegistry.scala, pramen/core/src/main/scala/za/co/absa/pramen/core/runner/{AppRunner,PipelineSparkSessionBuilder}.scala, pramen/core/src/main/scala/za/co/absa/pramen/core/runner/splitter/ScheduleStrategy*.scala, pramen/core/src/main/scala/za/co/absa/pramen/core/runner/task/ThreadClosableRegistry.scala, pramen/core/src/main/scala/za/co/absa/pramen/runner/PipelineRunner.scala
These components now create loggers using class-name strings without a trailing $. The scheduling files import LoggerFactory directly.
Metastore and pipeline loggers
pramen/core/src/main/scala/za/co/absa/pramen/core/metastore/MetastoreImpl.scala, pramen/core/src/main/scala/za/co/absa/pramen/core/metastore/model/MetaTable.scala, pramen/core/src/main/scala/za/co/absa/pramen/core/metastore/peristence/*.scala, pramen/core/src/main/scala/za/co/absa/pramen/core/pipeline/*.scala, pramen/core/src/main/scala/za/co/absa/pramen/core/rdb/PramenDb.scala, pramen/core/src/main/scala/za/co/absa/pramen/core/reader/model/TableReaderJdbcConfig.scala, pramen/core/src/main/scala/za/co/absa/pramen/core/sink/SparkSink.scala, pramen/core/src/main/scala/za/co/absa/pramen/core/source/{RawFileSource,SparkSource}.scala, pramen/core/src/main/scala_2.12/za/co/absa/pramen/core/metastore/peristence/MetastorePersistenceIcebergOps.scala, pramen/core/src/main/scala_2.13/za/co/absa/pramen/core/metastore/peristence/MetastorePersistenceIcebergOps.scala, pramen/core/src/test/scala/za/co/absa/pramen/core/mocks/dao/MongoDbSingleton.scala
These loggers now use class-name strings without a trailing $. The changes also remove unused imports and reorder reader imports.
SQL and utility loggers
pramen/core/src/main/scala/za/co/absa/pramen/core/sql/SqlGenerator*.scala, pramen/core/src/main/scala/za/co/absa/pramen/core/utils/*.scala, pramen/core/src/main/scala/za/co/absa/pramen/core/utils/hive/HiveHelper.scala
SQL generator and utility loggers now use class-name strings without a trailing $.
Extras loggers
pramen/extras/src/main/scala/za/co/absa/pramen/extras/infofile/InfoFileGeneration.scala, pramen/extras/src/main/scala/za/co/absa/pramen/extras/notification/EcsNotificationTarget.scala, pramen/extras/src/main/scala/za/co/absa/pramen/extras/sink/StandardizationSink.scala, pramen/extras/src/main/scala/za/co/absa/pramen/extras/utils/ConfigUtils.scala, pramen/extras/src/main/scala/za/co/absa/pramen/extras/utils/httpclient/SimpleHttpClient.scala, pramen/extras/src/main/scala/za/co/absa/pramen/extras/writer/TableWriterKafka.scala
These loggers now use class-name strings without a trailing $. The info-file code also removes an unused import.

Configuration Redaction Key

Layer / File(s) Summary
Add the Log4j threshold key
pramen/core/src/main/scala/za/co/absa/pramen/core/config/Keys.scala
CONFIG_KEYS_TO_REDACT now includes log4j2.discardThreshold.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to d64d9

Logger categories now omit the Scala object suffix, and configuration output masks the Log4j threshold value. No concrete merge-blocking risk is evident in the reviewed changes.

Pre-merge checks: Passed 5
Passed Passed checks: 5 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the primary change: removing the $ suffix from logger names in Scala companion objects.
Description check Passed The description includes the required Overview, Release Notes, and Related sections. The Release Notes section accurately describes the main change and the description also records the secondary logge…
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches: 💡 1
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit checks the logger name,
And trims a little dollar sign.
The config keys get one more guard,
While tidy imports leave the yard.
Then hops away through logs that shine.

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

JaCoCo Coverage Report

Metric (instruction) Coverage Threshold Status
Overall 73.02% 70.0% ✅
Changed Files 72.85% 70.0% ✅
Group Coverage (O/Ch) Threshold (O/Ch) Status (O/Ch)
pramen-core 73.9% / 73.48% 70.0% / 70.0% ✅/✅
pramen-extras 61.6% / 65.55% 60.0% / 60.0% ✅/✅
Report Coverage (O/Ch) Threshold (O/Ch) Status (O/Ch)
pramen:core Jacoco Report 73.9% / 73.48% 70.0% / 70.0% ✅/✅
pramen-extras Jacoco Report 61.6% / 65.55% 60.0% / 60.0% ✅/✅
File Path Coverage Threshold Status
AppRunner.scala 81.31% 60.0% ✅
Bookkeeper.scala 74.62% 60.0% ✅
BookkeeperConfig.scala 78.12% 60.0% ✅
BookkeeperDynamoDb.scala 5.67% 60.0% ❌
ConfigUtils.scala 81.93% 60.0% ✅
ConfigUtils.scala 55.31% 60.0% ❌
EcsNotificationTarget.scala 79.49% 60.0% ✅
HiveHelper.scala 78.92% 60.0% ✅
HookConfig.scala 91.23% 60.0% ✅
InfoFileGeneration.scala 84.74% 60.0% ✅
JdbcNativeUtils.scala 60.13% 60.0% ✅
JdbcSparkUtils.scala 84.76% 60.0% ✅
Keys.scala 44.64% 60.0% ❌
MetaTable.scala 88.45% 60.0% ✅
MetastoreImpl.scala 84.93% 60.0% ✅
MetastorePersistenceIceberg.scala 77.48% 60.0% ✅
MetastorePersistenceIcebergOps.scala 85.76% 60.0% ✅
MetastorePersistenceIcebergOps.scala 85.76% 60.0% ✅
MetastorePersistenceRaw.scala 87.37% 60.0% ✅
OperationDef.scala 80.29% 60.0% ✅
OperationSplitter.scala 82.5% 60.0% ✅
PipelineRunner.scala 70.83% 60.0% ✅
PipelineSparkSessionBuilder.scala 78.93% 60.0% ✅
PramenDb.scala 48.54% 60.0% ❌
RawFileSource.scala 77.12% 60.0% ✅
RunnerCommons.scala 74.8% 60.0% ✅
RuntimeConfig.scala 83.97% 60.0% ✅
ScheduleStrategyIncremental.scala 85.52% 60.0% ✅
ScheduleStrategySourcing.scala 98.3% 60.0% ✅
ScheduleStrategyUtils.scala 89.41% 60.0% ✅
ScheduleUtils.scala 79.56% 60.0% ✅
SimpleHttpClient.scala 100.0% 60.0% ✅
SinkTableParser.scala 66.24% 60.0% ✅
SourceTableParser.scala 77.03% 60.0% ✅
SparkSink.scala 84.98% 60.0% ✅
SparkSource.scala 91.12% 60.0% ✅
SparkUtils.scala 78.34% 60.0% ✅
SqlGeneratorDatabricks.scala 93.49% 60.0% ✅
SqlGeneratorDenodo.scala 92.75% 60.0% ✅
SqlGeneratorHive.scala 93.49% 60.0% ✅
SqlGeneratorLoader.scala 94.44% 60.0% ✅
SqlGeneratorSas.scala 93.67% 60.0% ✅
StandardizationSink.scala 79.61% 60.0% ✅
TableReaderJdbcConfig.scala 88.91% 60.0% ✅
TableWriterKafka.scala 4.53% 60.0% ❌
ThreadClosableRegistry.scala 70.87% 60.0% ✅
ThreadUtils.scala 80.36% 60.0% ✅
TimeUtils.scala 88.68% 60.0% ✅
TokenLockRegistry.scala 87.72% 60.0% ✅
TransferTableParser.scala 89.98% 60.0% ✅
TransientTableManager.scala 92.69% 60.0% ✅

Run 38525795884 · Event: pull_request

@yruslan
yruslan merged commit 9004f88 into main Oct 14, 2026
5 of 6 checks passed
@yruslan
yruslan deleted the feature/tidy-up-logs branch October 14, 2026 07:25
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.

1 participant