Instantiating custom LoggerFactory two times #5641
Closed
Comments
Still present in 3.8 - there are several calls to |
taburet
added a commit
to taburet/hazelcast
that referenced
this issue
Dec 29, 2017
taburet
added a commit
to taburet/hazelcast
that referenced
this issue
Jan 22, 2018
taburet
added a commit
to taburet/hazelcast
that referenced
this issue
Feb 15, 2018
taburet
added a commit
to taburet/hazelcast
that referenced
this issue
Feb 19, 2018
This change brings following: 1. Eliminates the chance of creating `hazelcast.logging.class` factory twice by doing the creation under the lock. 2. Improves the sharing of the static logger factory instance with `LoggingService`s. If the type of the the static logger factory matches with the type requested during the logging service construction, the service will receive the shared logger factory instance. 3. Fixes the issue with the shared factory get set while invoking `getLogger` when there is no `hazelcast.logging.type` setting provided. 4. Adds test cases to verify the expected behavior. Fixes: hazelcast#5641
taburet
added a commit
that referenced
this issue
Mar 14, 2018
This change brings following: 1. Eliminates the chance of creating `hazelcast.logging.class` factory twice by doing the creation under the lock. 2. Improves the sharing of the static logger factory instance with `LoggingService`s. If the type of the the static logger factory matches with the type requested during the logging service construction, the service will receive the shared logger factory instance. 3. Fixes the issue with the shared factory get set while invoking `getLogger` when there is no `hazelcast.logging.type` setting provided. 4. Adds test cases to verify the expected behavior. Fixes: #5641
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I am using hazelcast 3.4.1 and I implement custom LoggerFactory. While starting application it creates custom LoggerFactory two times if you are using XmlConfigBuilder for example. XmlConfigBuilder has LoggerFactory.getLogger(...) which creates custom LoggerFactory first time as it doesn't exist yet. Second time it is created when Hazelcast.newHazelcastInstance -> Node.init -> LoggingServiceImpl.init is called as it need to instantiate for application and it doesn't know that it exists already.
I think it would be better to prepare some singleton solution in LoggerFactory interface and stop using public constructor. Attaching stack traces of creating those two instances.
Thank you
The text was updated successfully, but these errors were encountered: