17 messages in org.apache.logging.log4j-userRE: conversion patterns and caller cl...
FromSent OnAttachments
Jacob KjomeJun 5, 2004 11:16 am 
Ceki GülcüJun 6, 2004 2:59 am 
Jacob KjomeJun 6, 2004 6:19 am 
Ceki GülcüJun 6, 2004 7:58 am 
Mark MastersonJun 6, 2004 9:03 am 
Jacob KjomeJun 6, 2004 11:33 am 
Jacob KjomeJun 6, 2004 11:50 am 
Ceki GülcüJun 7, 2004 6:21 am 
Jacob KjomeJun 7, 2004 4:29 pm 
Ceki GülcüJun 8, 2004 7:04 am 
Jacob KjomeJun 22, 2004 6:44 am 
KeithJun 22, 2004 8:01 am 
Jacob KjomeJun 22, 2004 10:32 am 
Alison OrtegaJun 22, 2004 10:50 am 
KeithJun 23, 2004 2:00 am 
Alison OrtegaJun 23, 2004 5:58 am 
Jacob KjomeJun 23, 2004 6:54 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:RE: conversion patterns and caller class informationActions...
From:Mark Masterson (m.ma@computer.org)
Date:Jun 6, 2004 9:03:50 am
List:org.apache.logging.log4j-user

Hi Jake,

In each class that will use the monitor, I just provide a Monitor instance

variable. I don't create the monitor in the class itself as is the normal Log4j usage.<<

Yeah, okay, that makes sense for the *component*. But how do you deal with the chicken-and-egg problems that you're inevitably confronted with in the *container*?

Specifically, how do you deal with a need for the container to be able to do things like logging during its *own* start-up and initialisation? Who tells the container how to log?

Once the container is up and running, the Monitor interface idea would obviously work, but the container still has the original problem. Arguably, this is an appreciable gain, in and of itself - rather than 20 components all individually having to worry about how to log while they're getting their feet under them, now only the container has to deal with such issues. But the issues are still there... Aren't they?

Hmmm... I suppose you could design Monitor implementations such that they could be instantiated cleanly via reflection, and then one would just have to have some meta-data source somewhere (properties file, deployment descriptor, whatever) where one configured a property for the container's "logging monitor"... But if one does this, I don't see how such a solution is fundamentally different from the following, which is alleged to be a "bad smell" on Pico Container's Web site...

public class AppleImpl implements Apple { private static Orange orange = OrangeFactory.getOrange(); public Apple() { } // other methods }

Presumably, in this solution, "OrangeFactory" is reading the above-mentioned meta-data source to find out what sort of "OrangeImpl" to create, and then using reflection to do so. So, if the container uses a similar trick to parameterise its own, internal logging, isn't it still suffering from a bad smell?

Cheers, Mark