Ok, turns out the reason I wasn't seeing any is because I had
filterExpression set to "filter" for some stupid reason...obviously that
won't work.

So now I think I've got it.  I have a DataCollector class with a Receiver
instance (the receiver it's interested in receiving messages from), and a
list of datasamples (the object I transform each LoggingEvent into).  When
DataCollector is Initialized it:

1) configures the Receiver by setting the LoggerRepository to a new instance
of Hierarchy with the root logger set as a Logger instance created from
Logger.getLogger(receiver.getName() + "Logger") (under the assumption that
the receiver names are unique, otherwise they will interfere with each
other).  
2) silence the "org.apache.log4j" logger by setting its level to Level.OFF
to eliminate the Receiver's tracing messages.

Putting each receiver in its own Hierarchy effectively isolates it from the
other DataCollectors and allows the each DataCollector to only get messages
from its own respective Receiver.

Sound about right?

Matt

Paul Smith-2 wrote:
> 
> 
> On 21/02/2008, at 8:07 AM, bakermatt wrote:
> 
>>
>> What Logger does a receiver post its LoggingEvents to?  I can't find  
>> it
>> anywhere in the LoggerRepository and it's driving me crazy.  I'm  
>> getting all
>> the messages from the Receiver itself, but none of the messages that  
>> the
>> Receiver is bringing in.  I need to know what Logger to attach my  
>> Appender
>> to.
>>
> 
> The event appears against the same logger that the original event was  
> generated from.
> 
> My advice is to attach a simple ConsoleAppender to the root of the  
> logger hierarchy and post a sample of the results you see, and flag  
> which class of event you're interested in trapping in your custom  
> appender.  Please also attach your log4j configuration file that is  
> configuring the Receiver and custom appender so we can help you.
> 
> cheers,
> 
> Paul
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/How-do-receivers-work--tp15576255p15601036.html
Sent from the Log4j - Users mailing list archive at Nabble.com.


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

Reply via email to