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 2006/07/13 21:31:09 UTC

DO NOT REPLY [Bug 37768] - BasicConfigurator - duplicated output

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=37768>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=37768


billdotnet@yahoo.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|CLOSED                      |REOPENED
         Resolution|INVALID                     |




------- Additional Comments From billdotnet@yahoo.com  2006-07-13 19:31 -------
Think about it ...

If BasicConfigurator.configure() is provided as a way to quickly configure
log4j, and you can't use it without the additivity problem, then this is a bug.

-Bill

(In reply to comment #4)
> Why should each invocation result in the same behavior when each time you call
> it, you add a new ConsoleAppender (by calling BasicConfigurator.configure() once
> for reach pass which adds a new ConsoleAppender).  Each console appender appends
> to the console.  When you have one, you get one line, two, two lines, three,
> three lines, etc...  A Log4j configuration is stored statically in memory and,
> as I explained before, configurations are additive; new configuration calls on
> the logger repository don't blow away the old ones, they just get added on. 
> It's as if you had a config file that stated...
> 
> <root>
>     <level value="DEBUG"/>
>     <appender-ref ref="Console"/>
>     <appender-ref ref="Console"/>
>     <appender-ref ref="Console"/>
>     <!--....-->
> </root>
> 
> Would you expect one line or multiple lines of output here?  If you expect one,
> you need to modify your expectations.
> 
> Or are you saying, "ok, I understand that, but I want Log4j to be smart about
> it."  "I want BasicConfigurator to detect whether there is already a
> ConsoleAppender attached and, if so, use that one rather than adding a new one
> to the root logger."  Fair enough, but I wouldn't consider this a bug.  And I
> can guarantee that behavior won't change in the 1.2.xx series.  It is possible
> that it might change in the 1.3.xx series.  I suggest that you post to the user
> list asking about whether this sort of change in behavior is desired by other
> users and, if so, whether a majority of committers agree.  If it is found that
> users and committers agree that behavior should be changed, then this report can
> be reopened.  Patches for the necesssary changes will help move things along as
> well.
> 
> Jake

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org