12 messages in org.apache.logging.log4j-userRE: Create LogFactory/Log for Log4j a...
FromSent OnAttachments
CAGATAY TUNALIJun 10, 2004 12:45 am 
Vernier, Dominique (DVernier)Jun 10, 2004 12:48 am 
Ceki GülcüJun 10, 2004 2:19 am 
Vernier, Dominique (DVernier)Jun 10, 2004 2:35 am 
Ceki GülcüJun 10, 2004 3:38 am 
Vernier, Dominique (DVernier)Jun 10, 2004 5:50 am 
CAGATAY TUNALIJun 10, 2004 6:28 am 
Thomas MullerJun 10, 2004 6:30 am 
Shirish GoelJun 11, 2004 9:24 pm 
mrut...@westpac.com.auJun 15, 2004 4:22 pm 
mrut...@westpac.com.auJun 15, 2004 4:27 pm 
mrut...@westpac.com.auJun 15, 2004 4:27 pm 
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: Create LogFactory/Log for Log4j and use commons.loggingActions...
From:Thomas Muller (tt@online.no)
Date:Jun 10, 2004 6:30:45 am
List:org.apache.logging.log4j-user

/Please/ refrain from posting items that ask for receipt.

--

Thomas

-----Original Message----- From: Vernier, Dominique (DVernier) [mailto:dver@relaystar.com] Sent: 10 June 2004 13:51 To: Log4J Users List Subject: RE: Create LogFactory/Log for Log4j and use commons.logging

Ceki,

I use a stand alone Java app and J2EE applications and the idea was to reuse the same Logger classes. But I will remove my MyLogger and forget the watch facility...

Thanks Dominique

-----Original Message----- From: Ceki Gülcü [mailto:ce@qos.ch] Sent: jeudi 10 juin 2004 12:39 To: Log4J Users List Subject: RE: Create LogFactory/Log for Log4j and use commons.logging

Hi Dominique,

What a combination. Sigh.

1) DOMConfigurator.configureAndWatch() should be avoided (except in stand-alone Hava apps) because it opens a thread which never dies.

2) You don't need to sub class Logger in order to invoke DOMConfigurator.configureAndWatch().

3) You should not sub class Logger in the first place as explained in Chapter 8 of "The complete log4j manual" of which I believe you own a copy.

HTH,

At 11:35 AM 6/10/2004, you wrote:

In MyLogger I set use DOMConfigurator.configureAndWatch() to set a Watch period.

-----Original Message----- From: Ceki Gülcü [mailto:ce@qos.ch] Sent: jeudi 10 juin 2004 11:20 To: Log4J Users List Subject: Re: Create LogFactory/Log for Log4j and use commons.logging

In what way does MyLogger differ from o.a.log4j.Logger?

At 09:49 AM 6/10/2004, Vernier, Dominique (DVernier) wrote:

Hi,

I would like to use commons.logging with Log4j has underlying logging system. I know that commos.logging will use Log4j if it found in the class path, but I would like to create my own LogFactory and use:

import org.apache.commons.logging.Log;

import org.apache.commons.logging.LogFactory;

private static Log logger = LogFactory.getLog(Test.class);

I know also that by setting system property -Dorg.apache.commons.logging.Log=... we can define the Log class used

by commons.logging.LogFactory to instanciate the Logger.

Then based on the sample of MyLoggerFactory and MyLogger, I create my own factory and logger. I implement the commons.logging.Log in the MyLogger, but when I used it I have a nullpointer on the repository.

Do you have any idea or examples on which I can relie?

Thx Dominique

-- Ceki Gülcü

For log4j documentation consider "The complete log4j manual" ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp

-- Ceki Gülcü

For log4j documentation consider "The complete log4j manual" ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp