Re: [DISSCUSSION] Common logger interface.

2021-06-11 Thread Andrey Mashenkov
Alex, Sorry, I've just found your question. > Is it really need to use thread-locals for user threads? - probably not. Your understanding is right, we can share a single logger instance for all non-Ignite threads. Igniters, I've created a ticket [1] to separate logs from different nodes. There

Re: [DISSCUSSION] Common logger interface.

2021-04-08 Thread Alexei Scherbakov
Andrey, The PR looks good to me. Maybe we can wrap all internal threads into IgniteThread - I'm almost sure this will work in this way. Is it really need to use thread-locals for user threads? - probably not. I'm not sure if there is any problem at all. As soon as we want to have async API every

Re: [DISSCUSSION] Common logger interface.

2021-04-08 Thread Andrey Mashenkov
Also, with the suggested approach, we should avoid indirectly usage of ForkJoinPool internally or set our own pool instance explicitly when using reactive things. On Thu, Apr 8, 2021 at 1:33 PM Andrey Mashenkov wrote: > Alexey, > > I've made a PR for logger [1]. > Seems, we will need 2 logger cl

Re: [DISSCUSSION] Common logger interface.

2021-04-08 Thread Andrey Mashenkov
Alexey, I've made a PR for logger [1]. Seems, we will need 2 logger classes. 1. Node-aware logger adapter, that will add node prefix to messages and delegate calls to System.Logger or whatever. 2. Logger wrapper that will get logger from a thread-local. I don't like to use ThreadLocal directly wh

Re: [DISSCUSSION] Common logger interface.

2021-04-08 Thread Alexei Scherbakov
Andrey, *final* word in the example is missing, my bad. I like the static logger approach. Regarding your comments: * The static logger can easily be used by multiple nodes in a single JVM, it's a matter of implementation. It can be achieved by setting thread local logger context for the node. F

Re: [DISSCUSSION] Common logger interface.

2021-04-07 Thread Andrey Mashenkov
Alexei, I see you've merged LoggerWrapper into main and use it in Raft module. I can't figure out what manner you suggest to use LoggerWrapper in. In the example above 'LOG' field is static, non-final and you create a wrapper explicitly. I see 2 ways: * Use a factory method to create a logger and

Re: [DISSCUSSION] Common logger interface.

2021-03-26 Thread Вячеслав Коптилин
Hello Alexei, It would be nice to add something like as follows: boolean isInfoEnabled(); boolean isDebugEnabled(); or boolean isLoggable(Level) - the same way which System.Logger suggests Thanks, S. пт, 26 мар. 2021 г. в 17:41, Alexei Scherbakov : > Andrey, > > I've introduced a ne

Re: [DISSCUSSION] Common logger interface.

2021-03-26 Thread Alexei Scherbakov
Andrey, I've introduced a new class LogWrapper to fix usability issues [1] The suggested usage is something like: private static LogWrapper LOG = new LogWrapper(MyClass.class); [1] https://github.com/gridgain/apache-ignite-3/blob/9acb050a6a6a601ead849797293a1d0ad48ab9e0/modules/core/src/main/ja

Re: [DISSCUSSION] Common logger interface.

2021-03-26 Thread Andrey Mashenkov
Forgot to attach a link to the PR with an example [1]. [1] https://github.com/apache/ignite-3/pull/59 On Fri, Mar 26, 2021 at 4:03 PM Andrey Mashenkov wrote: > Hi Igniters, > > In almost every new task we faced the problem of what logger has to be > used: JUL. log4J or any else. > > Since JDK 9