Given that properties are open-ended (you can have many many properties) it
is actually not trivial at all to arrange them in an inheritance hierarchy.
One simple approach is to have hierarchy-wide properties which can be
either set through config file or programmatically.
As in,
LogManager.getLoggerRepository().setProperty("someprop", "someval");
Thomas, would that suit your needs?
At 09:56 AM 9/22/2003 -0700, Scott Deboy wrote:
>I agree we need support for this sort of cross-thread context
>information....properties which are inheritable through the logger
>hierarchy may fit the bill..I haven't looked into implementation
>details, but here's an example:
>
>If you got the "org.apache.log4j" logger and called
>'setProperty("someprop", "someval"), then all loggers under
>org.apache.log4j would also have the property (you would also need
>support for removeProperty("someprop")). The property would be
>overridden if a closer ancestor set the property (if
>org.apache.log4j.net set the same property).
>
>Opinions dev folks?
>
>
>-----Original Message-----
>From: Thomas Muller [mailto:ttm@online.no]
>Sent: Monday, September 22, 2003 1:09 AM
>To: log4j-user@jakarta.apache.org
>Subject: Alternative contexts for MDC/NDC
>
>
>Log4j gurus,
>
>Does log4j have support for MDC/NDC across other contexts than threads?
>If not, is it any plans to implement this? For the time being I find my
>self having to prefix log messages with context sensitive information,
>and it doesn't really "feel" right at all.
>
>Any suggestions for a MDC/NDC framework allowing arbitrary contexts
>would be much appreciated, and also how to incorporate it into
>PatternLayout etc.
>
>--
>
>Thomas
>
>
>
>************************************************************************
>*
>Copyright ERA Technology Ltd. 2003. (www.era.co.uk). All rights
>reserved.
>The information supplied in this Commercial Communication should be
>treated in confidence. No liability whatsoever is accepted for any loss
>or damage
>suffered as a result of accessing this message or any attachments.
>
>________________________________________________________________________
>This email has been scanned for all viruses by the MessageLabs Email
>Security System. For more information on a proactive email security
>service working around the clock, around the globe, visit
>http://www.messagelabs.com
>________________________________________________________________________
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: log4j-user-help@jakarta.apache.org
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-dev-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: log4j-dev-help@jakarta.apache.org
--
Ceki Gülcü
For log4j documentation consider "The complete log4j manual"
ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp
import org.apache.Facetime;
ApacheCon US 2003, 18-21 November http://apachecon.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-dev-help@jakarta.apache.org
|