You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Andrey Mashenkov (Jira)" <ji...@apache.org> on 2021/06/11 10:34:00 UTC

[jira] [Created] (IGNITE-14897) Ignite node logger.

Andrey Mashenkov created IGNITE-14897:
-----------------------------------------

             Summary: Ignite node logger.
                 Key: IGNITE-14897
                 URL: https://issues.apache.org/jira/browse/IGNITE-14897
             Project: Ignite
          Issue Type: New Feature
            Reporter: Andrey Mashenkov


h3. Motivation
For now we use statically initialized loggers in classes. This can leads to mess in logs when user starts 2+ nodes in the same JVM and therefore, to harder or even impossible debugging.
Ignite-2 is not affected with this, because every node has a separate logger instance and can write logs into a separate file.

3. Description
To resolve this we should use separate logger for each node instance.

Possible solutions
# Avoid static logger usage.
# Use static wrappers for Thread-local loggers.

With the first approach, we have to pass loggers to every component via constructor or use dependency injection or create logger manually. Also, we should bother about passing correct logger category to the object that may use it and logger instance creation rate (if it is created in for every class instance)

With the second one, we can use a default single logger instance for user threads
and use thread-local like wrappers for Ignite node threads.
Instead of using a ThreadLocal class directly and avoid hash-table lookups, we can introduce IgniteThread class with a Logger field.
The logger may either add a node prefix to all messages or delegate calls to other logger of certain category (if we want to or will be able to support different logger configurations for different nodes).




--
This message was sent by Atlassian Jira
(v8.3.4#803005)