Skip to content
This repository was archived by the owner on Feb 18, 2026. It is now read-only.
This repository was archived by the owner on Feb 18, 2026. It is now read-only.

Adopt KotlinLogging across project (replace SLF4J LoggerFactory) #550

@yacosta738

Description

@yacosta738

The coding guidelines specify using KotlinLogging for lazy evaluation and Kotlin idioms, but the project currently lacks this dependency and uses SLF4J's LoggerFactory consistently. This file follows the established pattern; however, if the team decides to migrate to KotlinLogging, add it to gradle/libs.versions.toml and refactor all logging instances.

Background and rationale:

  • KotlinLogging provides idiomatic Kotlin logging APIs and supports lazy evaluation which avoids unnecessary string allocation.
  • Current codebase initializes loggers via org.slf4j.LoggerFactory and therefore can't use KotlinLogging conveniences.
  • Migrating will make logging more consistent with Kotlin idioms and reduce allocations in hot paths.

Acceptance criteria / checklist:

  1. Add KotlinLogging dependency to gradle/libs.versions.toml (include a suggested version entry) and to relevant Gradle modules (server/engine and any Kotlin modules).
  2. Replace LoggerFactory.getLogger(...) usage with mu.KotlinLogging.logger {} (or recommended KotlinLogging pattern) across the codebase.
  3. Ensure logging calls use lazy evaluation where appropriate (e.g., logger.debug { "... $value" }).
  4. Run ./gradlew build and relevant unit/integration tests and fix any compile errors introduced by migration.
  5. Update coding guidelines/docs to reference KotlinLogging and give examples.
  6. Optional: Provide a small automated codemod or script (grep/sed/ktlint/gradle-migrator) to help mass-refactor logging statements.

Additional notes for the assignee:

  • Start by adding the dependency to gradle/libs.versions.toml so the project compiles.
  • Search for LoggerFactory.getLogger and org.slf4j.LoggerFactory usages; those are the primary migration targets.
  • Validate the change in CI and ensure no logging tests break.

Suggested labels: tech-debt, refactor, backend, kotlin.
Priority: medium.
Estimate: 2-4 days depending on scope.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions