Projects tigase _server server-core Issues #1211
Migrate to slf4j (#1211)
Open
wojciech.kapcia@tigase.net opened 4 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.net commented 3 years ago

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

wojciech.kapcia@tigase.net 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.net commented 1 year ago

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

wojciech.kapcia@tigase.net batch edited 5 months ago
Name Previous Value Current Value
Iterations
empty
tigase-server-8.4.0
wojciech.kapcia@tigase.net added "Related" #1034 5 months ago
wojciech.kapcia@tigase.net changed fields 5 months ago
Name Previous Value Current Value
Version
tigase-server-8.4.0
tigase-server-9.0.0
wojciech.kapcia@tigase.net added to iteration "tigase-server-9.0.0" 5 months ago
wojciech.kapcia@tigase.net removed from iteration "tigase-server-8.4.0" 5 months ago
wojciech.kapcia@tigase.net commented 4 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.net changed title 4 months ago
Previous Value Current Value
Migrate to System.Logger
Migrate to slf4j
wojciech.kapcia@tigase.net referenced from other issue 3 months ago
Referenced from commit 2 months ago
Referenced from commit 2 months ago
wojciech.kapcia@tigase.net commented 2 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.

Please wait...
Page is in error, reload to recover