You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by bu...@apache.org on 2011/04/11 13:38:03 UTC
DO NOT REPLY [Bug 51048] New: AsyncAppender.doAppend() does not to
be synchronized
https://issues.apache.org/bugzilla/show_bug.cgi?id=51048
Summary: AsyncAppender.doAppend() does not to be synchronized
Product: Log4j
Version: 1.2
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: normal
Priority: P2
Component: Appender
AssignedTo: log4j-dev@logging.apache.org
ReportedBy: kowalewski.bartosz@gmail.com
The AppenderSkeleton class defines the 'public synchronized void
doAppend(LoggingEvent event)' method. Making this method non synchronized
directly in AppenderSkeleton isn't safe as there are might be plenty of (custom
3rd party) subclasses that might take advantage of this synchronization.
However, some widely used _concrete_ appenders that are defined inside the
log4j library could be optimized. The AsyncAppender class seems to be the most
often used appender in enterprise class systems. Making the doAppend() method
non synchronized in this case makes a lot of sense as checking if level is
lower than threshold is done in doAppend(). This change would improve log4j
behavior in multi-threaded environments.
AsyncAppender is anyway internally synchronized - it synchronizes on the buffer
field.
Attaching a subclass of AsyncAppender that removes the unnecessary
'synchronized' keyword.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org
DO NOT REPLY [Bug 51048] AsyncAppender.doAppend() does not need to
be synchronized
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51048
--- Comment #1 from Bartek <ko...@gmail.com> 2011-04-11 07:39:23 EDT ---
Created an attachment (id=26872)
--> (https://issues.apache.org/bugzilla/attachment.cgi?id=26872)
A subclass of AsyncAppender that removes the unneeded synchronization
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org
DO NOT REPLY [Bug 51048] AsyncAppender.doAppend() does not need to
be synchronized
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51048
Leigh L. Klotz, Jr. <le...@xerox.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |leigh.klotz@xerox.com
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org
DO NOT REPLY [Bug 51048] AsyncAppender.doAppend() does not need to
be synchronized
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=51048
Bartek <ko...@gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|AsyncAppender.doAppend() |AsyncAppender.doAppend()
|does not to be synchronized |does not need to be
| |synchronized
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org