Re: Synchronization issue in multithreading (Losing huge data in multithreading) with log4j 1.x bridge (2.17.2)

Matt Sicker <[email protected]>
Newsgroups gmane.comp.jakarta.log4j.user
Message-ID <CACmp6kr_GnxKLhWwAr4Wj_G3pvHPr2ceuhjikehX0gi_WCM+Fw@mail.gmail.com>
None of those attachments made it through to the mailing list.

On Thu, Mar 24, 2022 at 6:22 PM Pooja Pandey <[email protected]>
wrote:

> Attaching sample test program for simulated multithreading logging.
>
>
>
> *From:* Pooja Pandey <[email protected]>
> *Sent:* Friday, March 25, 2022 4:37 AM
> *To:* Log4J Users List <[email protected]>
> *Subject:* Synchronization issue in multithreading (Losing huge data in
> multithreading) with log4j 1.x bridge (2.17.2)
>
>
>
> **** External email: Verify sender before opening attachments or links ****
>
>
>
> Hi,
>
>
>
> In our application we have migrated from log4j1.x to log4j1.x bridge. With
> Log4j1.x there was no issue with multithreading but with log4j 1.x bridge
> we have noticed that in multithreading environment there is a huge data
> loss while logging, however single thread works fine. I see that in
> Category.java which Logger extends; many methods are not synchronized any
> more in log4j1.x bridge however which were in case of log4j1.x. I suspect
> this could be root cause of this multithreading problem. Please let me know
> if you have any idea.
>
>
>
> I have compared Category.java which is a kind of core class for logging
> functionality in Log4j1.x and Log4j1.x bridge and I see that many methods
> which we are using were synchronized in log4j1.x but NOT in log4j1.x
> bridge. I think this could be one of the root causes leading to this
> problem.
>
>
>
>
>
> Log4j1.x:   synchronized public Appender getAppender(String name)
>
> Log4j1.x bridge:     public Appender getAppender(final String name)
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.