Projects tigase _server server-core Issues #1211
Migrate to slf4j (#1211)
Wojciech Kapcia (Tigase) opened 5 years ago

In Java9 JEP 264: Platform Logging API and Service was implemented. It introduces a minimal logging API (which defaults to JUL, but makes it possible to use alternative logging solutions easier). Considering that with Tigase 8.2 we bumped minimal Java version to 11 we should update our sources to use System.Logger.

Ref: Java 9 Platform Logging API



Items:

  • Wojciech Kapcia (Tigase) commented 3 years ago

    Minor, "cosmetic" change, let's push it to 8.3.0

  • Wojciech Kapcia (Tigase) commented 2 years ago

    I'm not sure if we shouldn't go slf4j (MIT licence simple facade, I'd say "standard" in projects, which offers more flexibility and we already do have it as dependency because some dependencies already required it) instead of quite limited System.Logger, which seems to be intended more for internal use even, as per https://openjdk.org/jeps/264:

    Non-Goals:

    • It is not a goal to define a general-purpose interface for logging. The service interface contains only the minimal set of methods that the JDK needs for its own usage.
  • Wojciech Kapcia (Tigase) commented 2 years ago

    Consider using MDC (https://logback.qos.ch/manual/mdc.html; for JID, sesssion-id, connection-id)

  • Wojciech Kapcia (Tigase) batch edited 12 months ago
    Name Previous Value Current Value
    Iterations
    empty
    tigase-server-8.4.0
  • Wojciech Kapcia (Tigase) added "Related" #1034 12 months ago
  • Wojciech Kapcia (Tigase) changed fields 12 months ago
    Name Previous Value Current Value
    Version
    tigase-server-8.4.0
    tigase-server-9.0.0
  • Wojciech Kapcia (Tigase) added to iteration "tigase-server-9.0.0" 12 months ago
  • Wojciech Kapcia (Tigase) removed from iteration "tigase-server-8.4.0" 12 months ago
  • Wojciech Kapcia (Tigase) commented 11 months ago

    In the end I think we should go with slf4j as it gives more flexibility and it's basically a standard. What's more, it would give us nice and easy integration with Loki via: https://loki4j.github.io/loki-logback-appender/.

    I started exploring OpenRewrite (https://docs.openrewrite.org/) to handle the migration though recipes to migrate away from JUL are either non-existent or utterly rudimentary.

  • Wojciech Kapcia (Tigase) changed title 11 months ago
    Previous Value Current Value
    Migrate to System.Logger
    Migrate to slf4j
  • Wojciech Kapcia (Tigase) referenced from other issue 9 months ago
  • Wojciech Kapcia (Tigase) commented 9 months ago

    tigase-utils and tigase-xmltools migrated to System.Logger (instead of slf4j) as those are tiny libraries with very minimal logging thus avoiding additional dependency is convenient (and slf4j can be used as provider if present, otherwise JUL will be used as a default fallback). Remaining projects should use slf4j as it gives more flexibility and additional features.

issue 1 of 1
Type
Task
Priority
Minor
Assignee
Version
tigase-server-9.0.0
Iterations
Issue Votes (0)
Watchers (2)
Reference
tigase/_server/server-core#1211
Please wait...
Page is in error, reload to recover