commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Neidhart (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LOGGING-135) Thread-safety improvements
Date Fri, 18 Jan 2013 12:47:11 GMT

    [ https://issues.apache.org/jira/browse/LOGGING-135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13557187#comment-13557187
] 

Thomas Neidhart commented on LOGGING-135:
-----------------------------------------

Applied first bunch of changes in r1435115:

 * SimpleLog:
 ** made fields logName and shortLogName volatile -> should become private final in next
major version
 ** made modifiable field currentLogLevel volatile
 ** made protected static fields showLogName, showShortName, showDateTime and dateTimeFormat
volatile -> should become private in next major version with static getters?

 * AvalonLogger:
 ** made static field defaultLogger volatile: there is already a static setter, so this should
be fine

Open:

  * Log4JLogger: logger field
  * LogKitLogger: logger field

I would prefer to change the logger to a final field (Log4JLogger), always set the logger
in the ctors and change the getLogger to just return the field. For LogKitLogger we can not
set it final as it is a protected field, so adding volatile for now, and postpone for the
next major version to change it to private.
                
> Thread-safety improvements
> --------------------------
>
>                 Key: LOGGING-135
>                 URL: https://issues.apache.org/jira/browse/LOGGING-135
>             Project: Commons Logging
>          Issue Type: Bug
>            Reporter: Sebb
>
> The LogKitLogger.logger field is not final or volatile so changes are not guaranteed
to be published.
> This includes calls to getLogger(), so two different threads using the same instance
can theoretically both create the logger.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message