At 05:02 PM 1/11/2005, Stefan Bodewig wrote:
It might be better to state somewhere that BuildListeners are not
allowed to create any output during messageLogged and keep the code as
is - and modify Log4jListener which I've never looked into myself.

Ceki, is there any way Log4jListener can avoid the output?  Probably
not since it tries to pick the "correct" logger at runtime.

Hello Stefan,

Log4jListener tries to use the most suitable logger depending on the
contents of BuildEvent. When it has determined the most suitable
logger name, it invokes

 Logger.getLogger("most suitable name");

In log4j version 1.3alpha output on the console is generated
by every call to Logger.getLogger. I can't think of anything reasonable
Log4jListener can do to prevent this or dance around it. Moreover,
this idiosyncrasy might even survive, in one form or another, in
log4j 1.3final.

The hypothesis of all listeners being able to avoid accessing the
console from within the messageLogged(event) method is not verified in
this case. I understand your reluctance to change the code. At this
stage, log4j's behavior might seem quite strange but at least you
should be aware that such eccentricity exists.

Best regards,

Stefan

-- Ceki Gülcü

  The complete log4j manual: http://www.qos.ch/log4j/



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to