logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ceki Gülcü <c...@qos.ch>
Subject RE: Multiple Log4J instances in one VM
Date Wed, 07 Aug 2002 08:50:07 GMT

Gee. How about configuring your own branch of the hierarchy? As in

log4j.logger.com.my.library=debug, F
log4j.additivity.com.my.library=false

log4j.appender.F=org.apache.log4j.FileAppender
log4j.appender.F.File=xyz.log
log4j.appender.F.layout=org.apache.log4j.PatternLayout
log4j.appender.F.layout.ConversionPattern=%r %p %t %c - %m%n


At 09:38 07.08.2002 +0100, you wrote:
>Log4j's somewhat static configuration approach strikes me as quite
>non-object-oriented since it in many ways violates encapsulation and
>instantiation; a natural requirement for a logging API is that different
>parts of a program (running in the same VM) should be able to configure
>their own "instances" of Log4j independent of eachother, e.g. they should
>not need to ask eachother or the API itself whether it's configured.
>
>Everything considered, it seems like getting Log4j to work smoothly (as is)
>in a multiple configuration environemt is a cumbersome and unintuitive task,
>and clearly needs to be addressed in later versions.
>
>--
>
>Thomas
>
>
>  | -----Original Message-----
>  | From: Ceki Gulcu [mailto:ceki@qos.ch]
>  | Sent: 07 August 2002 09:17
>  | To: Log4J Users List
>  | Subject: RE: Multiple Log4J instances in one VM
>  |
>  |
>  |
>  | Hmm, that is not it either. I was thinking of simply checking whether
>  | log4j is already configured. If a component detects that log4j is
>  | configured, it should not configure log4j.
>  |
>  | Here is a more elaborate explanation:
>  |
>  | http://marc.theaimsgroup.com/?l=log4j-user&m=102775658930710&w=2
>  |
>  |
>  | At 09:01 07.08.2002 +0100, you wrote:
>  | >As Ceki points out, there are other ways of solving this, e.g. by using
>  | >different hierarchies for the different "programs".
>  | >
>  | >See e.g. org.apache.log4j.net.SocketServer for an example of
>  | how to obtain
>  | >this.
>  | >
>  | >--
>  | >
>  | >Thomas
>  | >
>  | >
>  | >
>  | >  | -----Original Message-----
>  | >  | From: Thomas Muller [mailto:ttm@online.no]
>  | >  | Sent: 07 August 2002 08:22
>  | >  | To: Log4J Users List
>  | >  | Subject: RE: Multiple Log4J instances in one VM
>  | >  |
>  | >  |
>  | >  |
>  | >  |
>  | >  |  | -----Original Message-----
>  | >  |  | From: Hitzbleck, Andreas (ext. Mitarbeiter)
>  | >  |  | [mailto:Andreas.Hitzbleck@KVB.de]
>  | >  |  | Sent: 07 August 2002 08:18
>  | >  |  | To: 'log4j-user@jakarta.apache.org'
>  | >  |  | Subject: Multiple Log4J instances in one VM
>  | >  |  |
>  | >  |  |
>  | >  |  | Hello list,
>  | >  |  |
>  | >  |  | I am developing a java program which is integrated in a
>  | big content
>  | >  |  | management system. Thus, our code runs with some other
>  | java programs
>  | >  |  | developed by other companies in one virtual mashine.
>  | >  |  |
>  | >  |  | Unfortunately, the Log4J initialization of one program of another
>  | >  |  | company overwrites our Log4J configuration or - if we start up
>  | >  |  | our program later - vice versa. I think that is because of the
>  | >  |  | statically implementation(s) of the configure() methods in
>  | >  |  | Property- Basic- and DOMConfigurator?
>  | >  |  |
>  | >  |  | Is there a way to solve this problem or to work around it? Would
>  | >  |  | it help to implement my own classloader and load the
>  | Log4J classes
>  | >  |  | through this loader?
>  | >  |
>  | >  | Yes - different classloaders can utilize different log4j
>  | libraries and
>  | >  | configurations.
>  | >  |
>  | >  | --
>  | >  |
>  | >  | Thomas
>  | >  |
>  | >  |
>  | >  |
>  | >  |
>  | >  |
>  | >  |
>  | >  |
>  | *************************************************************************
>  | >  | Copyright ERA Technology Ltd. 2002. (www.era.co.uk). All rights
>  | >  | reserved.
>  | >  | The information supplied in this email 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 SkyScan
>  | >  | service. For more information on a proactive anti-virus
>  | service working
>  | >  | around the clock, around the globe, visit http://www.messagelabs.com
>  | >  |
>  | ________________________________________________________________________
>  | >  |
>  | >  | --
>  | >  | To unsubscribe, e-mail:
>  | ><mailto:log4j-user-unsubscribe@jakarta.apache.org>
>  | >For additional commands, e-mail:
><mailto:log4j-user-help@jakarta.apache.org>
> >
> >
> >
> >
> >*************************************************************************
> >Copyright ERA Technology Ltd. 2002. (www.era.co.uk). All rights reserved.
> >The information supplied in this email 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 SkyScan
> >service. For more information on a proactive anti-virus service working
> >around the clock, around the globe, visit http://www.messagelabs.com
> >________________________________________________________________________
> >
> >--
> >To unsubscribe, e-mail:
><mailto:log4j-user-unsubscribe@jakarta.apache.org>
> >For additional commands, e-mail:
><mailto:log4j-user-help@jakarta.apache.org>
>
>--
>Ceki
>
>
>--
>To unsubscribe, e-mail:   <mailto:log4j-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: <mailto:log4j-user-help@jakarta.apache.org>
>
>
>
>
>*************************************************************************
>Copyright ERA Technology Ltd. 2002. (www.era.co.uk). All rights reserved.
>The information supplied in this email 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 SkyScan
>service. For more information on a proactive anti-virus service working
>around the clock, around the globe, visit http://www.messagelabs.com
>________________________________________________________________________
>
>--
>To unsubscribe, e-mail:   <mailto:log4j-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: <mailto:log4j-user-help@jakarta.apache.org>

--
Ceki


--
To unsubscribe, e-mail:   <mailto:log4j-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:log4j-user-help@jakarta.apache.org>


Mime
View raw message