You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Igor Smirnov <ig...@prozone.co.yu> on 2004/05/10 09:58:15 UTC

Monolog help

Hi,

This is my first time posting here! :)
I've working with commons logging for the past week and have implemented a new logger within for my needs.
Now, since I am not confortable with the whole commons package yet and the user's guide doesn't help much, could anyone explain me step by step how to set-up my system to use the new logger?

Thanks,
Igor.

Re: [logging] How to get logging to use new Monolog subclass

Posted by Igor Smirnov <ig...@prozone.co.yu>.
----- Original Message -----
From: "Simon Kitching" <si...@ecnetwork.co.nz>
To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
Sent: Monday, May 10, 2004 10:56 AM
Subject: Re: [logging] How to get logging to use new Monolog subclass

>
>
> As Jose mentioned, you can just set a system property on the jvm command
> line:
>   java -Dorg.apache.commons.logging.Log=your.log.class
> (described in the LogFactoryImpl javadoc)
>

I guess this works only if I have the .class exposed an not withing a jar
file?


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [logging] How to get logging to use new Monolog subclass

Posted by José Antonio Pérez Testa <ja...@indra.es>.
It can be a classloading issue. :<

In my tomcat commons-logging-api.jar does not have log4j implementation.
Maybe this sounds very heavy but, try renaming ALL 
commons-logging-api.jar to commons-logging-api.jarrenamed and
try to force loading of commons-logging.jar from your WEB-INF/lib directory.

Another possible solution  could be  to hire  a  GhostBuster Team :)

Igor Smirnov wrote:

>Thanks Jose,
>
>Well, I made a little progress:
>For whatever reason commons-logging-api.jar doesn't see neither log4j nor
>monolog's jars.
>So, i.e. LogFactoryImpl.java:
>protected boolean isLog4JAvailable() {
>try {
>loadClass("org.apache.log4j.Logger");
>...
>
>doesn't load lof4j. Trows exception instead. I tried moving my jar in every
>single directory in Tomcat but did not help.
>Any fresh ideas? :)
>
>----- Original Message -----
>From: "José Antonio Pérez Testa" <ja...@indra.es>
>To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
>Sent: Wednesday, May 12, 2004 6:19 PM
>Subject: Re: [logging] How to get logging to use new Monolog subclass
>
>
>  
>
>>Try an empty implementation of MonologLogger. Maybe the implementation
>>also uses logs in any way ...
>>If the empty implementation gets instantiated the problem will be in
>>your implementation.
>>
>>If not try replacing all that code for
>>return new MonologLogger("Forced")
>>
>>and see what happen ...
>>I'm running out of ideas :)
>>
>>Igor Smirnov wrote:
>>
>>    
>>
>>>This is odd:
>>>logClass.getConstructor(logConstructorSignature)
>>>
>>>return a No Class Definition Exception!
>>>
>>>and here are the values
>>>logClass= Class (org.apache.commons.logging.impl.MonologLogger)
>>>I DO have a
>>>   public MonologLogger(String name) {
>>>       this.logger=lf.getLogger(name);
>>>   }
>>>
>>>
>>>----- Original Message -----
>>>From: "José Antonio Pérez Testa" <ja...@indra.es>
>>>To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
>>>Sent: Wednesday, May 12, 2004 3:31 PM
>>>Subject: Re: [logging] How to get logging to use new Monolog subclass
>>>
>>>
>>>
>>>
>>>      
>>>
>>>>Well done!
>>>>if everything is right  logClass must be YourImplementation.class and
>>>>if  YourImplementation has a constructor like
>>>>public YourImplementation(String name) {....}
>>>>it HAS TO work!!
>>>>
>>>>
>>>>
>>>>        
>>>>
>
>  
>

-------------------------------------------------------------------------------------------------------------------
Este correo electrónico y, en su caso, cualquier fichero anexo al mismo, contiene información de carácter confidencial exclusivamente dirigida a su destinatario o destinatarios. Queda prohibida su divulgación, copia o distribución a terceros sin la previa autorización escrita de Indra. En el caso de haber recibido este correo electrónico por error, se ruega notificar inmediatamente esta circunstancia mediante reenvío a la dirección electrónica del remitente.

The information in this e-mail and in any attachments is confidential and solely for the attention and use of the named addressee(s). You are hereby notified that any dissemination, distribution or copy of this communication is prohibited without the prior written consent of Indra. If you have received this communication in error, please, notify the sender by reply e-mail

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [logging] How to get logging to use new Monolog subclass

Posted by Igor Smirnov <ig...@prozone.co.yu>.
As previously said, I'd need to set a system logger.
I start tomcat with catalina start. Now, looking into Tomcat 5 classloader
doc
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/class-loader-howto.html
, I've found that using this script only a few .jars will be loaded (Check
the page).
I am run-time debugging commons logging and that is why I needed to start
this script. I am about yo try starting tomcat differently and will report
my findings shortly...
Thanks, Igor

----- Original Message -----
From: "Tatu Vanhanen" <ta...@graftor.fi>
To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
Sent: Thursday, May 13, 2004 12:02 PM
Subject: RE: [logging] How to get logging to use new Monolog subclass


> Maybe you know this already, but here some thoughts; correct me if I'm
> wrong!
>
> If you have your log (i.e. Monolog) classes in the webapp's classpath (jar
> in WEB-INF/lib or classes in WEB-INF/classes), you also need to place the
> commons-loggin jar to each webapp where the Monolog is used. The reason is
> that the webapp classloader sees classes in the parent loader's classpath
> (Tomcat shared lib, for example), but the shared classloader does not see
> classes in the webapps' classpath. So, if commons-logging is placed in the
> Tomcat shared lib, it can not load classes placed in a webapp's classpath.
>
> I think the same applies also to property files: they can be found in the
> WEB-INF/classes only if the log classes that need them are also placed in
> the webapp.
>
> Where you have placed the Monolog and commons-logging classes?
>
> - Tatu V.
>
> > -----Original Message-----
> > From: Igor Smirnov [mailto:igor@prozone.co.yu]
> > Sent: 13. toukokuuta 2004 12:21
> > To: Jakarta Commons Users List
> > Subject: Re: [logging] How to get logging to use new Monolog subclass
> >
> >
> > Thanks Jose,
> >
> > Well, I made a little progress:
> > For whatever reason commons-logging-api.jar doesn't see neither log4j
nor
> > monolog's jars.
> > So, i.e. LogFactoryImpl.java:
> > protected boolean isLog4JAvailable() {
> > try {
> > loadClass("org.apache.log4j.Logger");
> > ...
> >
> > doesn't load lof4j. Trows exception instead. I tried moving my
> > jar in every
> > single directory in Tomcat but did not help.
> > Any fresh ideas? :)
> >
> > ----- Original Message -----
> > From: "José Antonio Pérez Testa" <ja...@indra.es>
> > To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
> > Sent: Wednesday, May 12, 2004 6:19 PM
> > Subject: Re: [logging] How to get logging to use new Monolog subclass
> >
> >
> > > Try an empty implementation of MonologLogger. Maybe the implementation
> > > also uses logs in any way ...
> > > If the empty implementation gets instantiated the problem will be in
> > > your implementation.
> > >
> > > If not try replacing all that code for
> > > return new MonologLogger("Forced")
> > >
> > > and see what happen ...
> > > I'm running out of ideas :)
> > >
> > > Igor Smirnov wrote:
> > >
> > > >This is odd:
> > > >logClass.getConstructor(logConstructorSignature)
> > > >
> > > >return a No Class Definition Exception!
> > > >
> > > >and here are the values
> > > >logClass= Class (org.apache.commons.logging.impl.MonologLogger)
> > > >I DO have a
> > > >    public MonologLogger(String name) {
> > > >        this.logger=lf.getLogger(name);
> > > >    }
> > > >
> > > >
> > > >----- Original Message -----
> > > >From: "José Antonio Pérez Testa" <ja...@indra.es>
> > > >To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
> > > >Sent: Wednesday, May 12, 2004 3:31 PM
> > > >Subject: Re: [logging] How to get logging to use new Monolog subclass
> > > >
> > > >
> > > >
> > > >
> > > >>Well done!
> > > >>if everything is right  logClass must be YourImplementation.class
and
> > > >>if  YourImplementation has a constructor like
> > > >>public YourImplementation(String name) {....}
> > > >>it HAS TO work!!
> > > >>
> > > >>
> > > >>
> > > >
> > > >
> > > >---------------------------------------------------------------------
> > > >To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> > > >For additional commands, e-mail: commons-user-help@jakarta.apache.org
> > > >
> > > >
> > > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: commons-user-help@jakarta.apache.org
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [logging] How to get logging to use new Monolog subclass

Posted by Igor Smirnov <ig...@prozone.co.yu>.
Ok, y'all, starting Tomcat as a service loads 4j as well so at least this
part of the problem seams solved.
the catalina.bat script which I use to start tomcat in debug mode lead me to
to oversee this class loading issues.

I am figuring out the ways to start tomcat in debug mode now and still have
loaded all the necessary jars.

----- Original Message -----
From: "José Antonio Pérez Testa" <ja...@indra.es>
To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
Sent: Thursday, May 13, 2004 12:37 PM
Subject: Re: [logging] How to get logging to use new Monolog subclass


> And in the WEB-INF/lib ???
>
> Igor Smirnov wrote:
>
> >Well, I put my jar in all lib places.
> >commons-logging.api.jar
> >log4j-1.2.8.jar
> >monolog.jar
> >
> >are in tomcat/bin, tomcat, tomcat/common/lib, tomcat/shared/lib.
> >
> >----- Original Message -----
> >From: "Tatu Vanhanen" <ta...@graftor.fi>
> >To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
> >Sent: Thursday, May 13, 2004 12:02 PM
> >Subject: RE: [logging] How to get logging to use new Monolog subclass
> >
> >
> >
> >
> >>Maybe you know this already, but here some thoughts; correct me if I'm
> >>wrong!
> >>
> >>If you have your log (i.e. Monolog) classes in the webapp's classpath
(jar
> >>in WEB-INF/lib or classes in WEB-INF/classes), you also need to place
the
> >>commons-loggin jar to each webapp where the Monolog is used. The reason
is
> >>that the webapp classloader sees classes in the parent loader's
classpath
> >>(Tomcat shared lib, for example), but the shared classloader does not
see
> >>classes in the webapps' classpath. So, if commons-logging is placed in
the
> >>Tomcat shared lib, it can not load classes placed in a webapp's
classpath.
> >>
> >>I think the same applies also to property files: they can be found in
the
> >>WEB-INF/classes only if the log classes that need them are also placed
in
> >>the webapp.
> >>
> >>Where you have placed the Monolog and commons-logging classes?
> >>
> >>- Tatu V.
> >>
> >>
> >>
> >>>-----Original Message-----
> >>>From: Igor Smirnov [mailto:igor@prozone.co.yu]
> >>>Sent: 13. toukokuuta 2004 12:21
> >>>To: Jakarta Commons Users List
> >>>Subject: Re: [logging] How to get logging to use new Monolog subclass
> >>>
> >>>
> >>>Thanks Jose,
> >>>
> >>>Well, I made a little progress:
> >>>For whatever reason commons-logging-api.jar doesn't see neither log4j
> >>>
> >>>
> >nor
> >
> >
> >>>monolog's jars.
> >>>So, i.e. LogFactoryImpl.java:
> >>>protected boolean isLog4JAvailable() {
> >>>try {
> >>>loadClass("org.apache.log4j.Logger");
> >>>...
> >>>
> >>>doesn't load lof4j. Trows exception instead. I tried moving my
> >>>jar in every
> >>>single directory in Tomcat but did not help.
> >>>Any fresh ideas? :)
> >>>
> >>>----- Original Message -----
> >>>From: "José Antonio Pérez Testa" <ja...@indra.es>
> >>>To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
> >>>Sent: Wednesday, May 12, 2004 6:19 PM
> >>>Subject: Re: [logging] How to get logging to use new Monolog subclass
> >>>
> >>>
> >>>
> >>>
> >>>>Try an empty implementation of MonologLogger. Maybe the implementation
> >>>>also uses logs in any way ...
> >>>>If the empty implementation gets instantiated the problem will be in
> >>>>your implementation.
> >>>>
> >>>>If not try replacing all that code for
> >>>>return new MonologLogger("Forced")
> >>>>
> >>>>and see what happen ...
> >>>>I'm running out of ideas :)
> >>>>
> >>>>Igor Smirnov wrote:
> >>>>
> >>>>
> >>>>
> >>>>>This is odd:
> >>>>>logClass.getConstructor(logConstructorSignature)
> >>>>>
> >>>>>return a No Class Definition Exception!
> >>>>>
> >>>>>and here are the values
> >>>>>logClass= Class (org.apache.commons.logging.impl.MonologLogger)
> >>>>>I DO have a
> >>>>>   public MonologLogger(String name) {
> >>>>>       this.logger=lf.getLogger(name);
> >>>>>   }
> >>>>>
> >>>>>
> >>>>>----- Original Message -----
> >>>>>From: "José Antonio Pérez Testa" <ja...@indra.es>
> >>>>>To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
> >>>>>Sent: Wednesday, May 12, 2004 3:31 PM
> >>>>>Subject: Re: [logging] How to get logging to use new Monolog subclass
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>>Well done!
> >>>>>>if everything is right  logClass must be YourImplementation.class
> >>>>>>
> >>>>>>
> >and
> >
> >
> >>>>>>if  YourImplementation has a constructor like
> >>>>>>public YourImplementation(String name) {....}
> >>>>>>it HAS TO work!!
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>---------------------------------------------------------------------
> >>>>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> >>>>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>---------------------------------------------------------------------
> >>>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> >>>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >>>>
> >>>>
> >>>>
> >>>---------------------------------------------------------------------
> >>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> >>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >>>
> >>>
> >>>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >>
> >>
> >>
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >
> >
> >
>
> --------------------------------------------------------------------------
-----------------------------------------
> Este correo electrónico y, en su caso, cualquier fichero anexo al mismo,
contiene información de carácter confidencial exclusivamente dirigida a su
destinatario o destinatarios. Queda prohibida su divulgación, copia o
distribución a terceros sin la previa autorización escrita de Indra. En el
caso de haber recibido este correo electrónico por error, se ruega notificar
inmediatamente esta circunstancia mediante reenvío a la dirección
electrónica del remitente.
>
> The information in this e-mail and in any attachments is confidential and
solely for the attention and use of the named addressee(s). You are hereby
notified that any dissemination, distribution or copy of this communication
is prohibited without the prior written consent of Indra. If you have
received this communication in error, please, notify the sender by reply
e-mail
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [logging] How to get logging to use new Monolog subclass

Posted by Igor Smirnov <ig...@prozone.co.yu>.
I need my logger work as a system logger -> that means I need to set it
right from the Tomcat start. I am trying to forward all the logging done in
Tomcat to log4j and/or monolog. So, the setings for applications alone
aren't enough.
I read a tutorial where it said, I needed to copy commons-logging.jar and
log4j into common/lib, and setup the properties files in common/classes
which I did.

Now, I might be doing something wrong here:
I compile the new commong logging, I get two files commons-logging.jar and
commons-logging-api.jar
api doesn't have the implementations except for the JDK logger. Am I
suppossed to copy both of these files to a dedicated folder within Tomcat
for the implementation to work correctly? If I remove the -api.jar, and copy
the implementation jar, I get an exception in Tomcat saying it couldn't find
it and it looks for it since it's (Tomcat says) in the classpath.
I might be messing thigs up here.

----- Original Message -----
From: "José Antonio Pérez Testa" <ja...@indra.es>
To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
Sent: Thursday, May 13, 2004 12:37 PM
Subject: Re: [logging] How to get logging to use new Monolog subclass


> And in the WEB-INF/lib ???
>
> Igor Smirnov wrote:
>
> >Well, I put my jar in all lib places.
> >commons-logging.api.jar
> >log4j-1.2.8.jar
> >monolog.jar
> >
> >are in tomcat/bin, tomcat, tomcat/common/lib, tomcat/shared/lib.
> >
> >----- Original Message -----
> >From: "Tatu Vanhanen" <ta...@graftor.fi>
> >To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
> >Sent: Thursday, May 13, 2004 12:02 PM
> >Subject: RE: [logging] How to get logging to use new Monolog subclass
> >
> >
> >
> >
> >>Maybe you know this already, but here some thoughts; correct me if I'm
> >>wrong!
> >>
> >>If you have your log (i.e. Monolog) classes in the webapp's classpath
(jar
> >>in WEB-INF/lib or classes in WEB-INF/classes), you also need to place
the
> >>commons-loggin jar to each webapp where the Monolog is used. The reason
is
> >>that the webapp classloader sees classes in the parent loader's
classpath
> >>(Tomcat shared lib, for example), but the shared classloader does not
see
> >>classes in the webapps' classpath. So, if commons-logging is placed in
the
> >>Tomcat shared lib, it can not load classes placed in a webapp's
classpath.
> >>
> >>I think the same applies also to property files: they can be found in
the
> >>WEB-INF/classes only if the log classes that need them are also placed
in
> >>the webapp.
> >>
> >>Where you have placed the Monolog and commons-logging classes?
> >>
> >>- Tatu V.
> >>
> >>
> >>
> >>>-----Original Message-----
> >>>From: Igor Smirnov [mailto:igor@prozone.co.yu]
> >>>Sent: 13. toukokuuta 2004 12:21
> >>>To: Jakarta Commons Users List
> >>>Subject: Re: [logging] How to get logging to use new Monolog subclass
> >>>
> >>>
> >>>Thanks Jose,
> >>>
> >>>Well, I made a little progress:
> >>>For whatever reason commons-logging-api.jar doesn't see neither log4j
> >>>
> >>>
> >nor
> >
> >
> >>>monolog's jars.
> >>>So, i.e. LogFactoryImpl.java:
> >>>protected boolean isLog4JAvailable() {
> >>>try {
> >>>loadClass("org.apache.log4j.Logger");
> >>>...
> >>>
> >>>doesn't load lof4j. Trows exception instead. I tried moving my
> >>>jar in every
> >>>single directory in Tomcat but did not help.
> >>>Any fresh ideas? :)
> >>>
> >>>----- Original Message -----
> >>>From: "José Antonio Pérez Testa" <ja...@indra.es>
> >>>To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
> >>>Sent: Wednesday, May 12, 2004 6:19 PM
> >>>Subject: Re: [logging] How to get logging to use new Monolog subclass
> >>>
> >>>
> >>>
> >>>
> >>>>Try an empty implementation of MonologLogger. Maybe the implementation
> >>>>also uses logs in any way ...
> >>>>If the empty implementation gets instantiated the problem will be in
> >>>>your implementation.
> >>>>
> >>>>If not try replacing all that code for
> >>>>return new MonologLogger("Forced")
> >>>>
> >>>>and see what happen ...
> >>>>I'm running out of ideas :)
> >>>>
> >>>>Igor Smirnov wrote:
> >>>>
> >>>>
> >>>>
> >>>>>This is odd:
> >>>>>logClass.getConstructor(logConstructorSignature)
> >>>>>
> >>>>>return a No Class Definition Exception!
> >>>>>
> >>>>>and here are the values
> >>>>>logClass= Class (org.apache.commons.logging.impl.MonologLogger)
> >>>>>I DO have a
> >>>>>   public MonologLogger(String name) {
> >>>>>       this.logger=lf.getLogger(name);
> >>>>>   }
> >>>>>
> >>>>>
> >>>>>----- Original Message -----
> >>>>>From: "José Antonio Pérez Testa" <ja...@indra.es>
> >>>>>To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
> >>>>>Sent: Wednesday, May 12, 2004 3:31 PM
> >>>>>Subject: Re: [logging] How to get logging to use new Monolog subclass
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>>Well done!
> >>>>>>if everything is right  logClass must be YourImplementation.class
> >>>>>>
> >>>>>>
> >and
> >
> >
> >>>>>>if  YourImplementation has a constructor like
> >>>>>>public YourImplementation(String name) {....}
> >>>>>>it HAS TO work!!
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>---------------------------------------------------------------------
> >>>>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> >>>>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>---------------------------------------------------------------------
> >>>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> >>>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >>>>
> >>>>
> >>>>
> >>>---------------------------------------------------------------------
> >>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> >>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >>>
> >>>
> >>>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >>
> >>
> >>
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >
> >
> >
>
> --------------------------------------------------------------------------
-----------------------------------------
> Este correo electrónico y, en su caso, cualquier fichero anexo al mismo,
contiene información de carácter confidencial exclusivamente dirigida a su
destinatario o destinatarios. Queda prohibida su divulgación, copia o
distribución a terceros sin la previa autorización escrita de Indra. En el
caso de haber recibido este correo electrónico por error, se ruega notificar
inmediatamente esta circunstancia mediante reenvío a la dirección
electrónica del remitente.
>
> The information in this e-mail and in any attachments is confidential and
solely for the attention and use of the named addressee(s). You are hereby
notified that any dissemination, distribution or copy of this communication
is prohibited without the prior written consent of Indra. If you have
received this communication in error, please, notify the sender by reply
e-mail
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [logging] How to get logging to use new Monolog subclass

Posted by José Antonio Pérez Testa <ja...@indra.es>.
Try the way back from your custom implementation to the original.
Documentation states that changing only the commons-logging.properties 
you can select LogFactory and Log implementations.

Igor Smirnov wrote:

>Everything runs smoothly now, although I have small problems with monolog
>but that's not an issue here.
>What interests me now is, can I implement a new logger without changing the
>org.apache.commons.logging.impl.LogFactoryImpl
>or I do have to make changes there too (as is the case right now).
>Thanks
>
>  
>

-------------------------------------------------------------------------------------------------------------------
Este correo electr�nico y, en su caso, cualquier fichero anexo al mismo, contiene informaci�n de car�cter confidencial exclusivamente dirigida a su destinatario o destinatarios. Queda prohibida su divulgaci�n, copia o distribuci�n a terceros sin la previa autorizaci�n escrita de Indra. En el caso de haber recibido este correo electr�nico por error, se ruega notificar inmediatamente esta circunstancia mediante reenv�o a la direcci�n electr�nica del remitente.

The information in this e-mail and in any attachments is confidential and solely for the attention and use of the named addressee(s). You are hereby notified that any dissemination, distribution or copy of this communication is prohibited without the prior written consent of Indra. If you have received this communication in error, please, notify the sender by reply e-mail

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [logging] How to get logging to use new Monolog subclass

Posted by Igor Smirnov <ig...@prozone.co.yu>.
Everything runs smoothly now, although I have small problems with monolog
but that's not an issue here.
What interests me now is, can I implement a new logger without changing the
org.apache.commons.logging.impl.LogFactoryImpl
or I do have to make changes there too (as is the case right now).
Thanks
----- Original Message -----
From: "José Antonio Pérez Testa" <ja...@indra.es>
To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
Sent: Thursday, May 13, 2004 12:37 PM
Subject: Re: [logging] How to get logging to use new Monolog subclass


> And in the WEB-INF/lib ???
>
> Igor Smirnov wrote:
>
> >Well, I put my jar in all lib places.
> >commons-logging.api.jar
> >log4j-1.2.8.jar
> >monolog.jar
> >
> >are in tomcat/bin, tomcat, tomcat/common/lib, tomcat/shared/lib.
> >
> >----- Original Message -----
> >From: "Tatu Vanhanen" <ta...@graftor.fi>
> >To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
> >Sent: Thursday, May 13, 2004 12:02 PM
> >Subject: RE: [logging] How to get logging to use new Monolog subclass
> >
> >
> >
> >
> >>Maybe you know this already, but here some thoughts; correct me if I'm
> >>wrong!
> >>
> >>If you have your log (i.e. Monolog) classes in the webapp's classpath
(jar
> >>in WEB-INF/lib or classes in WEB-INF/classes), you also need to place
the
> >>commons-loggin jar to each webapp where the Monolog is used. The reason
is
> >>that the webapp classloader sees classes in the parent loader's
classpath
> >>(Tomcat shared lib, for example), but the shared classloader does not
see
> >>classes in the webapps' classpath. So, if commons-logging is placed in
the
> >>Tomcat shared lib, it can not load classes placed in a webapp's
classpath.
> >>
> >>I think the same applies also to property files: they can be found in
the
> >>WEB-INF/classes only if the log classes that need them are also placed
in
> >>the webapp.
> >>
> >>Where you have placed the Monolog and commons-logging classes?
> >>
> >>- Tatu V.
> >>
> >>
> >>
> >>>-----Original Message-----
> >>>From: Igor Smirnov [mailto:igor@prozone.co.yu]
> >>>Sent: 13. toukokuuta 2004 12:21
> >>>To: Jakarta Commons Users List
> >>>Subject: Re: [logging] How to get logging to use new Monolog subclass
> >>>
> >>>
> >>>Thanks Jose,
> >>>
> >>>Well, I made a little progress:
> >>>For whatever reason commons-logging-api.jar doesn't see neither log4j
> >>>
> >>>
> >nor
> >
> >
> >>>monolog's jars.
> >>>So, i.e. LogFactoryImpl.java:
> >>>protected boolean isLog4JAvailable() {
> >>>try {
> >>>loadClass("org.apache.log4j.Logger");
> >>>...
> >>>
> >>>doesn't load lof4j. Trows exception instead. I tried moving my
> >>>jar in every
> >>>single directory in Tomcat but did not help.
> >>>Any fresh ideas? :)
> >>>
> >>>----- Original Message -----
> >>>From: "José Antonio Pérez Testa" <ja...@indra.es>
> >>>To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
> >>>Sent: Wednesday, May 12, 2004 6:19 PM
> >>>Subject: Re: [logging] How to get logging to use new Monolog subclass
> >>>
> >>>
> >>>
> >>>
> >>>>Try an empty implementation of MonologLogger. Maybe the implementation
> >>>>also uses logs in any way ...
> >>>>If the empty implementation gets instantiated the problem will be in
> >>>>your implementation.
> >>>>
> >>>>If not try replacing all that code for
> >>>>return new MonologLogger("Forced")
> >>>>
> >>>>and see what happen ...
> >>>>I'm running out of ideas :)
> >>>>
> >>>>Igor Smirnov wrote:
> >>>>
> >>>>
> >>>>
> >>>>>This is odd:
> >>>>>logClass.getConstructor(logConstructorSignature)
> >>>>>
> >>>>>return a No Class Definition Exception!
> >>>>>
> >>>>>and here are the values
> >>>>>logClass= Class (org.apache.commons.logging.impl.MonologLogger)
> >>>>>I DO have a
> >>>>>   public MonologLogger(String name) {
> >>>>>       this.logger=lf.getLogger(name);
> >>>>>   }
> >>>>>
> >>>>>
> >>>>>----- Original Message -----
> >>>>>From: "José Antonio Pérez Testa" <ja...@indra.es>
> >>>>>To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
> >>>>>Sent: Wednesday, May 12, 2004 3:31 PM
> >>>>>Subject: Re: [logging] How to get logging to use new Monolog subclass
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>>Well done!
> >>>>>>if everything is right  logClass must be YourImplementation.class
> >>>>>>
> >>>>>>
> >and
> >
> >
> >>>>>>if  YourImplementation has a constructor like
> >>>>>>public YourImplementation(String name) {....}
> >>>>>>it HAS TO work!!
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>---------------------------------------------------------------------
> >>>>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> >>>>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>---------------------------------------------------------------------
> >>>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> >>>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >>>>
> >>>>
> >>>>
> >>>---------------------------------------------------------------------
> >>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> >>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >>>
> >>>
> >>>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >>
> >>
> >>
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >
> >
> >
>
> --------------------------------------------------------------------------
-----------------------------------------
> Este correo electrónico y, en su caso, cualquier fichero anexo al mismo,
contiene información de carácter confidencial exclusivamente dirigida a su
destinatario o destinatarios. Queda prohibida su divulgación, copia o
distribución a terceros sin la previa autorización escrita de Indra. En el
caso de haber recibido este correo electrónico por error, se ruega notificar
inmediatamente esta circunstancia mediante reenvío a la dirección
electrónica del remitente.
>
> The information in this e-mail and in any attachments is confidential and
solely for the attention and use of the named addressee(s). You are hereby
notified that any dissemination, distribution or copy of this communication
is prohibited without the prior written consent of Indra. If you have
received this communication in error, please, notify the sender by reply
e-mail
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [logging] How to get logging to use new Monolog subclass

Posted by José Antonio Pérez Testa <ja...@indra.es>.
And in the WEB-INF/lib ???

Igor Smirnov wrote:

>Well, I put my jar in all lib places.
>commons-logging.api.jar
>log4j-1.2.8.jar
>monolog.jar
>
>are in tomcat/bin, tomcat, tomcat/common/lib, tomcat/shared/lib.
>
>----- Original Message -----
>From: "Tatu Vanhanen" <ta...@graftor.fi>
>To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
>Sent: Thursday, May 13, 2004 12:02 PM
>Subject: RE: [logging] How to get logging to use new Monolog subclass
>
>
>  
>
>>Maybe you know this already, but here some thoughts; correct me if I'm
>>wrong!
>>
>>If you have your log (i.e. Monolog) classes in the webapp's classpath (jar
>>in WEB-INF/lib or classes in WEB-INF/classes), you also need to place the
>>commons-loggin jar to each webapp where the Monolog is used. The reason is
>>that the webapp classloader sees classes in the parent loader's classpath
>>(Tomcat shared lib, for example), but the shared classloader does not see
>>classes in the webapps' classpath. So, if commons-logging is placed in the
>>Tomcat shared lib, it can not load classes placed in a webapp's classpath.
>>
>>I think the same applies also to property files: they can be found in the
>>WEB-INF/classes only if the log classes that need them are also placed in
>>the webapp.
>>
>>Where you have placed the Monolog and commons-logging classes?
>>
>>- Tatu V.
>>
>>    
>>
>>>-----Original Message-----
>>>From: Igor Smirnov [mailto:igor@prozone.co.yu]
>>>Sent: 13. toukokuuta 2004 12:21
>>>To: Jakarta Commons Users List
>>>Subject: Re: [logging] How to get logging to use new Monolog subclass
>>>
>>>
>>>Thanks Jose,
>>>
>>>Well, I made a little progress:
>>>For whatever reason commons-logging-api.jar doesn't see neither log4j
>>>      
>>>
>nor
>  
>
>>>monolog's jars.
>>>So, i.e. LogFactoryImpl.java:
>>>protected boolean isLog4JAvailable() {
>>>try {
>>>loadClass("org.apache.log4j.Logger");
>>>...
>>>
>>>doesn't load lof4j. Trows exception instead. I tried moving my
>>>jar in every
>>>single directory in Tomcat but did not help.
>>>Any fresh ideas? :)
>>>
>>>----- Original Message -----
>>>From: "José Antonio Pérez Testa" <ja...@indra.es>
>>>To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
>>>Sent: Wednesday, May 12, 2004 6:19 PM
>>>Subject: Re: [logging] How to get logging to use new Monolog subclass
>>>
>>>
>>>      
>>>
>>>>Try an empty implementation of MonologLogger. Maybe the implementation
>>>>also uses logs in any way ...
>>>>If the empty implementation gets instantiated the problem will be in
>>>>your implementation.
>>>>
>>>>If not try replacing all that code for
>>>>return new MonologLogger("Forced")
>>>>
>>>>and see what happen ...
>>>>I'm running out of ideas :)
>>>>
>>>>Igor Smirnov wrote:
>>>>
>>>>        
>>>>
>>>>>This is odd:
>>>>>logClass.getConstructor(logConstructorSignature)
>>>>>
>>>>>return a No Class Definition Exception!
>>>>>
>>>>>and here are the values
>>>>>logClass= Class (org.apache.commons.logging.impl.MonologLogger)
>>>>>I DO have a
>>>>>   public MonologLogger(String name) {
>>>>>       this.logger=lf.getLogger(name);
>>>>>   }
>>>>>
>>>>>
>>>>>----- Original Message -----
>>>>>From: "José Antonio Pérez Testa" <ja...@indra.es>
>>>>>To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
>>>>>Sent: Wednesday, May 12, 2004 3:31 PM
>>>>>Subject: Re: [logging] How to get logging to use new Monolog subclass
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>>>Well done!
>>>>>>if everything is right  logClass must be YourImplementation.class
>>>>>>            
>>>>>>
>and
>  
>
>>>>>>if  YourImplementation has a constructor like
>>>>>>public YourImplementation(String name) {....}
>>>>>>it HAS TO work!!
>>>>>>
>>>>>>
>>>>>>
>>>>>>            
>>>>>>
>>>>>---------------------------------------------------------------------
>>>>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>>>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>>>>
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>---------------------------------------------------------------------
>>>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>>>
>>>>        
>>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>>
>>>      
>>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>  
>

-------------------------------------------------------------------------------------------------------------------
Este correo electrónico y, en su caso, cualquier fichero anexo al mismo, contiene información de carácter confidencial exclusivamente dirigida a su destinatario o destinatarios. Queda prohibida su divulgación, copia o distribución a terceros sin la previa autorización escrita de Indra. En el caso de haber recibido este correo electrónico por error, se ruega notificar inmediatamente esta circunstancia mediante reenvío a la dirección electrónica del remitente.

The information in this e-mail and in any attachments is confidential and solely for the attention and use of the named addressee(s). You are hereby notified that any dissemination, distribution or copy of this communication is prohibited without the prior written consent of Indra. If you have received this communication in error, please, notify the sender by reply e-mail

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [logging] How to get logging to use new Monolog subclass

Posted by Igor Smirnov <ig...@prozone.co.yu>.
Well, I put my jar in all lib places.
commons-logging.api.jar
log4j-1.2.8.jar
monolog.jar

are in tomcat/bin, tomcat, tomcat/common/lib, tomcat/shared/lib.

----- Original Message -----
From: "Tatu Vanhanen" <ta...@graftor.fi>
To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
Sent: Thursday, May 13, 2004 12:02 PM
Subject: RE: [logging] How to get logging to use new Monolog subclass


> Maybe you know this already, but here some thoughts; correct me if I'm
> wrong!
>
> If you have your log (i.e. Monolog) classes in the webapp's classpath (jar
> in WEB-INF/lib or classes in WEB-INF/classes), you also need to place the
> commons-loggin jar to each webapp where the Monolog is used. The reason is
> that the webapp classloader sees classes in the parent loader's classpath
> (Tomcat shared lib, for example), but the shared classloader does not see
> classes in the webapps' classpath. So, if commons-logging is placed in the
> Tomcat shared lib, it can not load classes placed in a webapp's classpath.
>
> I think the same applies also to property files: they can be found in the
> WEB-INF/classes only if the log classes that need them are also placed in
> the webapp.
>
> Where you have placed the Monolog and commons-logging classes?
>
> - Tatu V.
>
> > -----Original Message-----
> > From: Igor Smirnov [mailto:igor@prozone.co.yu]
> > Sent: 13. toukokuuta 2004 12:21
> > To: Jakarta Commons Users List
> > Subject: Re: [logging] How to get logging to use new Monolog subclass
> >
> >
> > Thanks Jose,
> >
> > Well, I made a little progress:
> > For whatever reason commons-logging-api.jar doesn't see neither log4j
nor
> > monolog's jars.
> > So, i.e. LogFactoryImpl.java:
> > protected boolean isLog4JAvailable() {
> > try {
> > loadClass("org.apache.log4j.Logger");
> > ...
> >
> > doesn't load lof4j. Trows exception instead. I tried moving my
> > jar in every
> > single directory in Tomcat but did not help.
> > Any fresh ideas? :)
> >
> > ----- Original Message -----
> > From: "José Antonio Pérez Testa" <ja...@indra.es>
> > To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
> > Sent: Wednesday, May 12, 2004 6:19 PM
> > Subject: Re: [logging] How to get logging to use new Monolog subclass
> >
> >
> > > Try an empty implementation of MonologLogger. Maybe the implementation
> > > also uses logs in any way ...
> > > If the empty implementation gets instantiated the problem will be in
> > > your implementation.
> > >
> > > If not try replacing all that code for
> > > return new MonologLogger("Forced")
> > >
> > > and see what happen ...
> > > I'm running out of ideas :)
> > >
> > > Igor Smirnov wrote:
> > >
> > > >This is odd:
> > > >logClass.getConstructor(logConstructorSignature)
> > > >
> > > >return a No Class Definition Exception!
> > > >
> > > >and here are the values
> > > >logClass= Class (org.apache.commons.logging.impl.MonologLogger)
> > > >I DO have a
> > > >    public MonologLogger(String name) {
> > > >        this.logger=lf.getLogger(name);
> > > >    }
> > > >
> > > >
> > > >----- Original Message -----
> > > >From: "José Antonio Pérez Testa" <ja...@indra.es>
> > > >To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
> > > >Sent: Wednesday, May 12, 2004 3:31 PM
> > > >Subject: Re: [logging] How to get logging to use new Monolog subclass
> > > >
> > > >
> > > >
> > > >
> > > >>Well done!
> > > >>if everything is right  logClass must be YourImplementation.class
and
> > > >>if  YourImplementation has a constructor like
> > > >>public YourImplementation(String name) {....}
> > > >>it HAS TO work!!
> > > >>
> > > >>
> > > >>
> > > >
> > > >
> > > >---------------------------------------------------------------------
> > > >To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> > > >For additional commands, e-mail: commons-user-help@jakarta.apache.org
> > > >
> > > >
> > > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: commons-user-help@jakarta.apache.org
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


RE: [logging] How to get logging to use new Monolog subclass

Posted by Tatu Vanhanen <ta...@graftor.fi>.
Maybe you know this already, but here some thoughts; correct me if I'm
wrong!

If you have your log (i.e. Monolog) classes in the webapp's classpath (jar
in WEB-INF/lib or classes in WEB-INF/classes), you also need to place the
commons-loggin jar to each webapp where the Monolog is used. The reason is
that the webapp classloader sees classes in the parent loader's classpath
(Tomcat shared lib, for example), but the shared classloader does not see
classes in the webapps' classpath. So, if commons-logging is placed in the
Tomcat shared lib, it can not load classes placed in a webapp's classpath.

I think the same applies also to property files: they can be found in the
WEB-INF/classes only if the log classes that need them are also placed in
the webapp.

Where you have placed the Monolog and commons-logging classes?

- Tatu V.

> -----Original Message-----
> From: Igor Smirnov [mailto:igor@prozone.co.yu]
> Sent: 13. toukokuuta 2004 12:21
> To: Jakarta Commons Users List
> Subject: Re: [logging] How to get logging to use new Monolog subclass
>
>
> Thanks Jose,
>
> Well, I made a little progress:
> For whatever reason commons-logging-api.jar doesn't see neither log4j nor
> monolog's jars.
> So, i.e. LogFactoryImpl.java:
> protected boolean isLog4JAvailable() {
> try {
> loadClass("org.apache.log4j.Logger");
> ...
>
> doesn't load lof4j. Trows exception instead. I tried moving my
> jar in every
> single directory in Tomcat but did not help.
> Any fresh ideas? :)
>
> ----- Original Message -----
> From: "José Antonio Pérez Testa" <ja...@indra.es>
> To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
> Sent: Wednesday, May 12, 2004 6:19 PM
> Subject: Re: [logging] How to get logging to use new Monolog subclass
>
>
> > Try an empty implementation of MonologLogger. Maybe the implementation
> > also uses logs in any way ...
> > If the empty implementation gets instantiated the problem will be in
> > your implementation.
> >
> > If not try replacing all that code for
> > return new MonologLogger("Forced")
> >
> > and see what happen ...
> > I'm running out of ideas :)
> >
> > Igor Smirnov wrote:
> >
> > >This is odd:
> > >logClass.getConstructor(logConstructorSignature)
> > >
> > >return a No Class Definition Exception!
> > >
> > >and here are the values
> > >logClass= Class (org.apache.commons.logging.impl.MonologLogger)
> > >I DO have a
> > >    public MonologLogger(String name) {
> > >        this.logger=lf.getLogger(name);
> > >    }
> > >
> > >
> > >----- Original Message -----
> > >From: "José Antonio Pérez Testa" <ja...@indra.es>
> > >To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
> > >Sent: Wednesday, May 12, 2004 3:31 PM
> > >Subject: Re: [logging] How to get logging to use new Monolog subclass
> > >
> > >
> > >
> > >
> > >>Well done!
> > >>if everything is right  logClass must be YourImplementation.class and
> > >>if  YourImplementation has a constructor like
> > >>public YourImplementation(String name) {....}
> > >>it HAS TO work!!
> > >>
> > >>
> > >>
> > >
> > >
> > >---------------------------------------------------------------------
> > >To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> > >For additional commands, e-mail: commons-user-help@jakarta.apache.org
> > >
> > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [logging] How to get logging to use new Monolog subclass

Posted by Igor Smirnov <ig...@prozone.co.yu>.
Thanks Jose,

Well, I made a little progress:
For whatever reason commons-logging-api.jar doesn't see neither log4j nor
monolog's jars.
So, i.e. LogFactoryImpl.java:
protected boolean isLog4JAvailable() {
try {
loadClass("org.apache.log4j.Logger");
...

doesn't load lof4j. Trows exception instead. I tried moving my jar in every
single directory in Tomcat but did not help.
Any fresh ideas? :)

----- Original Message -----
From: "José Antonio Pérez Testa" <ja...@indra.es>
To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
Sent: Wednesday, May 12, 2004 6:19 PM
Subject: Re: [logging] How to get logging to use new Monolog subclass


> Try an empty implementation of MonologLogger. Maybe the implementation
> also uses logs in any way ...
> If the empty implementation gets instantiated the problem will be in
> your implementation.
>
> If not try replacing all that code for
> return new MonologLogger("Forced")
>
> and see what happen ...
> I'm running out of ideas :)
>
> Igor Smirnov wrote:
>
> >This is odd:
> >logClass.getConstructor(logConstructorSignature)
> >
> >return a No Class Definition Exception!
> >
> >and here are the values
> >logClass= Class (org.apache.commons.logging.impl.MonologLogger)
> >I DO have a
> >    public MonologLogger(String name) {
> >        this.logger=lf.getLogger(name);
> >    }
> >
> >
> >----- Original Message -----
> >From: "José Antonio Pérez Testa" <ja...@indra.es>
> >To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
> >Sent: Wednesday, May 12, 2004 3:31 PM
> >Subject: Re: [logging] How to get logging to use new Monolog subclass
> >
> >
> >
> >
> >>Well done!
> >>if everything is right  logClass must be YourImplementation.class and
> >>if  YourImplementation has a constructor like
> >>public YourImplementation(String name) {....}
> >>it HAS TO work!!
> >>
> >>
> >>
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [logging] How to get logging to use new Monolog subclass

Posted by José Antonio Pérez Testa <ja...@indra.es>.
Try an empty implementation of MonologLogger. Maybe the implementation 
also uses logs in any way ...
If the empty implementation gets instantiated the problem will be in 
your implementation.

If not try replacing all that code for
return new MonologLogger("Forced")

and see what happen ...
I'm running out of ideas :)

Igor Smirnov wrote:

>This is odd:
>logClass.getConstructor(logConstructorSignature)
>
>return a No Class Definition Exception!
>
>and here are the values
>logClass= Class (org.apache.commons.logging.impl.MonologLogger)
>I DO have a
>    public MonologLogger(String name) {
>        this.logger=lf.getLogger(name);
>    }
>
>
>----- Original Message -----
>From: "José Antonio Pérez Testa" <ja...@indra.es>
>To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
>Sent: Wednesday, May 12, 2004 3:31 PM
>Subject: Re: [logging] How to get logging to use new Monolog subclass
>
>
>  
>
>>Well done!
>>if everything is right  logClass must be YourImplementation.class and
>>if  YourImplementation has a constructor like
>>public YourImplementation(String name) {....}
>>it HAS TO work!!
>>
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [logging] How to get logging to use new Monolog subclass

Posted by Igor Smirnov <ig...@prozone.co.yu>.
This is odd:
logClass.getConstructor(logConstructorSignature)

return a No Class Definition Exception!

and here are the values
logClass= Class (org.apache.commons.logging.impl.MonologLogger)
I DO have a
    public MonologLogger(String name) {
        this.logger=lf.getLogger(name);
    }


----- Original Message -----
From: "José Antonio Pérez Testa" <ja...@indra.es>
To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
Sent: Wednesday, May 12, 2004 3:31 PM
Subject: Re: [logging] How to get logging to use new Monolog subclass


> Well done!
> if everything is right  logClass must be YourImplementation.class and
> if  YourImplementation has a constructor like
> public YourImplementation(String name) {....}
> it HAS TO work!!
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [logging] How to get logging to use new Monolog subclass

Posted by José Antonio Pérez Testa <ja...@indra.es>.
Well done!
if everything is right  logClass must be YourImplementation.class and 
if  YourImplementation has a constructor like
public YourImplementation(String name) {....}
it HAS TO work!!

Igor Smirnov wrote:

>First of all, I have to admin I'd been stupid! :)
>there is a commons-logging-api in bin folder, that isn't only the api but
>the whole implementation. When I removed it I finally could start doing
>actual tests...
>
>Now, I came up with an excepntion. I happens in getLogConstructor method od
>the LogFactoryImpl
>logMethod stays null, and logConstructor stays null, therefore
>LogConfigurationException!
>The code
>try {
>logMethod = logClass.getMethod("setLogFactory",
>logMethodSignature);
>} catch (Throwable t) {
>logMethod = null;}
>// Identify the corresponding constructor to be used
>try {
>logConstructor = logClass.getConstructor(logConstructorSignature);
>return (logConstructor);
>} catch (Throwable t) {
>throw new LogConfigurationException
>("No suitable Log constructor " + logConstructorSignature+ " for " +
>logClassName, t);}
>
>Igor
>
>  
>
-------------------------------------------------------------------------------------------------------------------
Este correo electrónico y, en su caso, cualquier fichero anexo al mismo, contiene información de carácter confidencial exclusivamente dirigida a su destinatario o destinatarios. Queda prohibida su divulgación, copia o distribución a terceros sin la previa autorización escrita de Indra. En el caso de haber recibido este correo electrónico por error, se ruega notificar inmediatamente esta circunstancia mediante reenvío a la dirección electrónica del remitente.

The information in this e-mail and in any attachments is confidential and solely for the attention and use of the named addressee(s). You are hereby notified that any dissemination, distribution or copy of this communication is prohibited without the prior written consent of Indra. If you have received this communication in error, please, notify the sender by reply e-mail

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [logging] How to get logging to use new Monolog subclass

Posted by Igor Smirnov <ig...@prozone.co.yu>.
First of all, I have to admin I'd been stupid! :)
there is a commons-logging-api in bin folder, that isn't only the api but
the whole implementation. When I removed it I finally could start doing
actual tests...

Now, I came up with an excepntion. I happens in getLogConstructor method od
the LogFactoryImpl
logMethod stays null, and logConstructor stays null, therefore
LogConfigurationException!
The code
try {
logMethod = logClass.getMethod("setLogFactory",
logMethodSignature);
} catch (Throwable t) {
logMethod = null;}
// Identify the corresponding constructor to be used
try {
logConstructor = logClass.getConstructor(logConstructorSignature);
return (logConstructor);
} catch (Throwable t) {
throw new LogConfigurationException
("No suitable Log constructor " + logConstructorSignature+ " for " +
logClassName, t);}

Igor

----- Original Message -----
From: "José Antonio Pérez Testa" <ja...@indra.es>
To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
Sent: Wednesday, May 12, 2004 1:20 PM
Subject: Re: [logging] How to get logging to use new Monolog subclass


> Reached this point, I would write System.out.println() statements after
> every line of the metod
> getLogClassName() of
>
> LogFactoryImpl.java
>
> and try to find out what is happenning ....
>
> Igor Smirnov wrote:
>
> >As previously said, I had implemented this method. It seams like I am not
> >getting any exceptions. I start the Tomcat up, it reads trough the
> >common-logging.properties, where it should initialize my logger.
> >I checked both my class and the logs for exceptions and haven't found
any.
> >
> >----- Original Message -----
> >From: "José Antonio Pérez Testa" <ja...@indra.es>
> >To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
> >Sent: Wednesday, May 12, 2004 11:45 AM
> >Subject: Re: [logging] How to get logging to use new Monolog subclass
> >
> >
> >
> >
> >>Can you add the code for 'isMonologAvailable()' ?
> >>
> >>it should look like log4j's:
> >>    protected boolean isLog4JAvailable() {
> >>
> >>        try {
> >>            loadClass("org.apache.log4j.Logger");
> >>            loadClass("org.apache.commons.logging.impl.Log4JLogger");
> >>            return (true);
> >>        } catch (Throwable t) {
> >>            return (false);
> >>        }
> >>    }
> >>so if you can load the implementation you can use it!
> >>
> >>In any case, you must be catching some kind of exception in some place,
> >>could you give the exception printStackTrace() ???
> >>
> >>Igor Smirnov wrote:
> >>
> >>
> >>
> >>>I've been trying to make it run, but I keep getting log4j instead. I
have
> >>>added to LogFactoryImpl.java.
> >>>
> >>>if ((logClassName == null) && isMonologAvailable()) {
> >>>           logClassName =
> >>>
> >>>
> >"org.apache.commons.logging.impl.MonologLogger";
> >
> >
> >>>       }
> >>>and isMonologAvailable() which returns true.
> >>>
> >>>Any ideas why it will not work? It seams like it falls back to log4j
> >>>
> >>>
> >(if?)
> >
> >
> >>>it doesn't find Monologs class.(?)
> >>>
> >>>Thanks,
> >>>Igor
> >>>
> >>>----- Original Message -----
> >>>From: "José Antonio Pérez Testa" <ja...@indra.es>
> >>>To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
> >>>Sent: Tuesday, May 11, 2004 12:16 PM
> >>>Subject: Re: [logging] How to get logging to use new Monolog subclass
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>>Well, now try this
> >>>>WEB_INF/classes/commons-logging.properties
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
>
>>org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogF
a
> >>
> >>
> >c
> >
> >
> >>>toryImpl
> >>>
> >>>
> >>>
> >>>
>
>>org.apache.commons.logging.Log=org.apache.commons.logging.impl.MonologLogg
e
> >>
> >>
> >r
> >
> >
> >>>
> >>>
> >>>>Igor Smirnov wrote:
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>>Following instructions, I made Commons Logging use log4j in Tomcat.
> >>>>>Now, everything runs smoothly, but - I still need to configure
Commons
> >>>>>Logging to use my new logger implementation:
> >>>>>org.apache.commons.logging.impl.MonologLogger
> >>>>>It is the implementation for Monolog (objectwebs project).
> >>>>>How does commong logging recognize custom loggers? Monolog uses it's
> >>>>>monolog.properties file to set up the logging events.
> >>>>>
> >>>>>Thank you
> >>>>>
> >>>>>----- Original Message -----
> >>>>>From: "José Antonio Pérez Testa" <ja...@indra.es>
> >>>>>To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
> >>>>>Sent: Monday, May 10, 2004 11:12 AM
> >>>>>Subject: Re: [logging] How to get logging to use new Monolog subclass
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>>By default Commons Logging uses Log4j implementation, if the
libraries
> >>>>>>are available on the classpath you should be able to log to a Log4j
> >>>>>>implementation without no configuration (apart from log4j.properties
> >>>>>>
> >>>>>>
> >or
> >
> >
> >>>>>>equivalent xml file).
> >>>>>>I am writing logs to log4j with Commons Logging in many projects and
> >>>>>>
> >>>>>>
> >the
> >
> >
> >>>>>>only difficults I've found  were with AppServer precedence of
> >>>>>>
> >>>>>>
> >libraries.
> >
> >
> >>>>>>You should try to configure log4j implementation first, and when
this
> >>>>>>implementation works give a try with Monolog
> >>>>>>
> >>>>>>
> >>>>>>Simon Kitching wrote:
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>>On Mon, 2004-05-10 at 20:22, Igor Smirnov wrote:
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>>Hollowing Simon's suggestion, I am posting the same question under
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>another
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>>>>Subject.
> >>>>>>>>
> >>>>>>>>And to be more specific: I am working tiwht Monolog logger that
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>implements
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>>>>and extends log4j functionality. I needed a new Log impl. in
commons
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>logging
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>>>>to be able to use Monolog logger with tomcat.
> >>>>>>>>Hopefully this clears it up. And here's the first post:
> >>>>>>>>
> >>>>>>>>I've working with commons logging for the past week and have
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>implemented
> >>>
> >>>
> >>>
> >>>
> >>>>>>>>
> >>>>>>>>
> >>>>>a
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>>>>new logger within for my needs.
> >>>>>>>>Now, since I am not confortable with the whole commons package yet
> >>>>>>>>
> >>>>>>>>
> >and
> >
> >
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>the
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>>>>user's guide doesn't help much, could anyone explain me step by
step
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>how
> >>>
> >>>
> >>>
> >>>
> >>>>>>>>
> >>>>>>>>
> >>>>>to
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>>>>set-up my system to use the new logger?
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>Cool, I'll have to look into monolog a bit.
> >>>>>>>
> >>>>>>>
> >>>>>>>As Jose mentioned, you can just set a system property on the jvm
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>command
> >>>
> >>>
> >>>
> >>>
> >>>>>>>line:
> >>>>>>>java -Dorg.apache.commons.logging.Log=your.log.class
> >>>>>>>(described in the LogFactoryImpl javadoc)
> >>>>>>>
> >>>>>>>This is fine for debugging, but isn't very nice when building
> >>>>>>>frameworks, etc. But from a quick peek at the code, it looks like
you
> >>>>>>>can also create a file "commons-logging.properties" and put it in
the
> >>>>>>>classpath, with these contents:
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
>
>>>>org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.Lo
g
> >>>>
> >>>>
> >F
> >
> >
> >>>>>
> >>>>>
> >>>a
> >>>
> >>>
> >>>
> >>>
> >>>>>>
> >>>>>>
> >>>>>ctoryImpl
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>>>org.apache.commons.logging.Log=your.log.class
> >>>>>>>
> >>>>>>>And as a third option, it looks like you could define your own
> >>>>>>>LogFactory subclass, and then specify it by creating a file:
> >>>>>>>META-INF/services/org.apache.commons.logging.LogFactory
> >>>>>>>with its first line being:
> >>>>>>>your.logfactory.class
> >>>>>>>
> >>>>>>>
> >>>>>>>I've only used the -D approach myself, so the above might be wrong.
> >>>>>>>
> >>>>>>>
> >As
> >
> >
> >>>>>>>always, the source code is the official and final documentation!
The
> >>>>>>>LogFactory and LogFactoryImpl classes are the ones that control all
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>this
> >>>
> >>>
> >>>
> >>>
> >>>>>>>behaviour.
> >>>>>>>
> >>>>>>>Regards,
> >>>>>>>
> >>>>>>>Simon
> >>>>>>>
> >>>>>>>
>
>>>>>>>---------------------------------------------------------------------
> >>>>>>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> >>>>>>>For additional commands, e-mail:
commons-user-help@jakarta.apache.org
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
>
>>>>------------------------------------------------------------------------
-
> >>>>
> >>>>
> >-
> >
> >
> >>>>>
> >>>>>
> >>>>>>
> >>>>>>
> >>>>>-----------------------------------------
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>>Este correo electrónico y, en su caso, cualquier fichero anexo al
> >>>>>>
> >>>>>>
> >mismo,
> >
> >
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>contiene información de carácter confidencial exclusivamente dirigida
a
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>su
> >>>
> >>>
> >>>
> >>>
> >>>>>destinatario o destinatarios. Queda prohibida su divulgación, copia o
> >>>>>distribución a terceros sin la previa autorización escrita de Indra.
En
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>el
> >>>
> >>>
> >>>
> >>>
> >>>>>caso de haber recibido este correo electrónico por error, se ruega
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>notificar
> >>>
> >>>
> >>>
> >>>
> >>>>>inmediatamente esta circunstancia mediante reenvío a la dirección
> >>>>>electrónica del remitente.
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>>The information in this e-mail and in any attachments is
confidential
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>and
> >>>
> >>>
> >>>
> >>>
> >>>>>>
> >>>>>>
> >>>>>solely for the attention and use of the named addressee(s). You are
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>hereby
> >>>
> >>>
> >>>
> >>>
> >>>>>notified that any dissemination, distribution or copy of this
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>communication
> >>>
> >>>
> >>>
> >>>
> >>>>>is prohibited without the prior written consent of Indra. If you have
> >>>>>received this communication in error, please, notify the sender by
> >>>>>
> >>>>>
> >reply
> >
> >
> >>>>>e-mail
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
>
>>>>>>---------------------------------------------------------------------
> >>>>>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> >>>>>>For additional commands, e-mail:
commons-user-help@jakarta.apache.org
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>---------------------------------------------------------------------
> >>>>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> >>>>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
>
>>>-------------------------------------------------------------------------
-
> >>>
> >>>
> >>>>
> >>>>
> >>>-----------------------------------------
> >>>
> >>>
> >>>
> >>>
> >>>>Este correo electrónico y, en su caso, cualquier fichero anexo al
mismo,
> >>>>
> >>>>
> >>>>
> >>>>
> >>>contiene información de carácter confidencial exclusivamente dirigida a
> >>>
> >>>
> >su
> >
> >
> >>>destinatario o destinatarios. Queda prohibida su divulgación, copia o
> >>>distribución a terceros sin la previa autorización escrita de Indra. En
> >>>
> >>>
> >el
> >
> >
> >>>caso de haber recibido este correo electrónico por error, se ruega
> >>>
> >>>
> >notificar
> >
> >
> >>>inmediatamente esta circunstancia mediante reenvío a la dirección
> >>>electrónica del remitente.
> >>>
> >>>
> >>>
> >>>
> >>>>The information in this e-mail and in any attachments is confidential
> >>>>
> >>>>
> >and
> >
> >
> >>>>
> >>>>
> >>>solely for the attention and use of the named addressee(s). You are
> >>>
> >>>
> >hereby
> >
> >
> >>>notified that any dissemination, distribution or copy of this
> >>>
> >>>
> >communication
> >
> >
> >>>is prohibited without the prior written consent of Indra. If you have
> >>>received this communication in error, please, notify the sender by
reply
> >>>e-mail
> >>>
> >>>
> >>>
> >>>
> >>>>---------------------------------------------------------------------
> >>>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> >>>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>---------------------------------------------------------------------
> >>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> >>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >>>
> >>>
> >>>
> >>>
> >>>
>
>>--------------------------------------------------------------------------
> >>
> >>
> >-----------------------------------------
> >
> >
> >>Este correo electrónico y, en su caso, cualquier fichero anexo al mismo,
> >>
> >>
> >contiene información de carácter confidencial exclusivamente dirigida a
su
> >destinatario o destinatarios. Queda prohibida su divulgación, copia o
> >distribución a terceros sin la previa autorización escrita de Indra. En
el
> >caso de haber recibido este correo electrónico por error, se ruega
notificar
> >inmediatamente esta circunstancia mediante reenvío a la dirección
> >electrónica del remitente.
> >
> >
> >>The information in this e-mail and in any attachments is confidential
and
> >>
> >>
> >solely for the attention and use of the named addressee(s). You are
hereby
> >notified that any dissemination, distribution or copy of this
communication
> >is prohibited without the prior written consent of Indra. If you have
> >received this communication in error, please, notify the sender by reply
> >e-mail
> >
> >
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >>
> >>
> >>
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >
> >
> >
>
> --------------------------------------------------------------------------
-----------------------------------------
> Este correo electrónico y, en su caso, cualquier fichero anexo al mismo,
contiene información de carácter confidencial exclusivamente dirigida a su
destinatario o destinatarios. Queda prohibida su divulgación, copia o
distribución a terceros sin la previa autorización escrita de Indra. En el
caso de haber recibido este correo electrónico por error, se ruega notificar
inmediatamente esta circunstancia mediante reenvío a la dirección
electrónica del remitente.
>
> The information in this e-mail and in any attachments is confidential and
solely for the attention and use of the named addressee(s). You are hereby
notified that any dissemination, distribution or copy of this communication
is prohibited without the prior written consent of Indra. If you have
received this communication in error, please, notify the sender by reply
e-mail
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [logging] How to get logging to use new Monolog subclass

Posted by José Antonio Pérez Testa <ja...@indra.es>.
Reached this point, I would write System.out.println() statements after 
every line of the metod
getLogClassName() of 

LogFactoryImpl.java

and try to find out what is happenning ....

Igor Smirnov wrote:

>As previously said, I had implemented this method. It seams like I am not
>getting any exceptions. I start the Tomcat up, it reads trough the
>common-logging.properties, where it should initialize my logger.
>I checked both my class and the logs for exceptions and haven't found any.
>
>----- Original Message -----
>From: "José Antonio Pérez Testa" <ja...@indra.es>
>To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
>Sent: Wednesday, May 12, 2004 11:45 AM
>Subject: Re: [logging] How to get logging to use new Monolog subclass
>
>
>  
>
>>Can you add the code for 'isMonologAvailable()' ?
>>
>>it should look like log4j's:
>>    protected boolean isLog4JAvailable() {
>>
>>        try {
>>            loadClass("org.apache.log4j.Logger");
>>            loadClass("org.apache.commons.logging.impl.Log4JLogger");
>>            return (true);
>>        } catch (Throwable t) {
>>            return (false);
>>        }
>>    }
>>so if you can load the implementation you can use it!
>>
>>In any case, you must be catching some kind of exception in some place,
>>could you give the exception printStackTrace() ???
>>
>>Igor Smirnov wrote:
>>
>>    
>>
>>>I've been trying to make it run, but I keep getting log4j instead. I have
>>>added to LogFactoryImpl.java.
>>>
>>>if ((logClassName == null) && isMonologAvailable()) {
>>>           logClassName =
>>>      
>>>
>"org.apache.commons.logging.impl.MonologLogger";
>  
>
>>>       }
>>>and isMonologAvailable() which returns true.
>>>
>>>Any ideas why it will not work? It seams like it falls back to log4j
>>>      
>>>
>(if?)
>  
>
>>>it doesn't find Monologs class.(?)
>>>
>>>Thanks,
>>>Igor
>>>
>>>----- Original Message -----
>>>From: "José Antonio Pérez Testa" <ja...@indra.es>
>>>To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
>>>Sent: Tuesday, May 11, 2004 12:16 PM
>>>Subject: Re: [logging] How to get logging to use new Monolog subclass
>>>
>>>
>>>
>>>
>>>      
>>>
>>>>Well, now try this
>>>>WEB_INF/classes/commons-logging.properties
>>>>
>>>>
>>>>
>>>>        
>>>>
>>org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFa
>>    
>>
>c
>  
>
>>>toryImpl
>>>
>>>
>>>      
>>>
>>org.apache.commons.logging.Log=org.apache.commons.logging.impl.MonologLogge
>>    
>>
>r
>  
>
>>>      
>>>
>>>>Igor Smirnov wrote:
>>>>
>>>>
>>>>
>>>>        
>>>>
>>>>>Following instructions, I made Commons Logging use log4j in Tomcat.
>>>>>Now, everything runs smoothly, but - I still need to configure Commons
>>>>>Logging to use my new logger implementation:
>>>>>org.apache.commons.logging.impl.MonologLogger
>>>>>It is the implementation for Monolog (objectwebs project).
>>>>>How does commong logging recognize custom loggers? Monolog uses it's
>>>>>monolog.properties file to set up the logging events.
>>>>>
>>>>>Thank you
>>>>>
>>>>>----- Original Message -----
>>>>>From: "José Antonio Pérez Testa" <ja...@indra.es>
>>>>>To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
>>>>>Sent: Monday, May 10, 2004 11:12 AM
>>>>>Subject: Re: [logging] How to get logging to use new Monolog subclass
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>>>By default Commons Logging uses Log4j implementation, if the libraries
>>>>>>are available on the classpath you should be able to log to a Log4j
>>>>>>implementation without no configuration (apart from log4j.properties
>>>>>>            
>>>>>>
>or
>  
>
>>>>>>equivalent xml file).
>>>>>>I am writing logs to log4j with Commons Logging in many projects and
>>>>>>            
>>>>>>
>the
>  
>
>>>>>>only difficults I've found  were with AppServer precedence of
>>>>>>            
>>>>>>
>libraries.
>  
>
>>>>>>You should try to configure log4j implementation first, and when this
>>>>>>implementation works give a try with Monolog
>>>>>>
>>>>>>
>>>>>>Simon Kitching wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>            
>>>>>>
>>>>>>>On Mon, 2004-05-10 at 20:22, Igor Smirnov wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>              
>>>>>>>
>>>>>>>>Hollowing Simon's suggestion, I am posting the same question under
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>                
>>>>>>>>
>>>>>another
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>>>>>Subject.
>>>>>>>>
>>>>>>>>And to be more specific: I am working tiwht Monolog logger that
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>                
>>>>>>>>
>>>>>implements
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>>>>>and extends log4j functionality. I needed a new Log impl. in commons
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>                
>>>>>>>>
>>>>>logging
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>>>>>to be able to use Monolog logger with tomcat.
>>>>>>>>Hopefully this clears it up. And here's the first post:
>>>>>>>>
>>>>>>>>I've working with commons logging for the past week and have
>>>>>>>>
>>>>>>>>
>>>>>>>>                
>>>>>>>>
>>>implemented
>>>
>>>
>>>      
>>>
>>>>>>>>                
>>>>>>>>
>>>>>a
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>>>>>new logger within for my needs.
>>>>>>>>Now, since I am not confortable with the whole commons package yet
>>>>>>>>                
>>>>>>>>
>and
>  
>
>>>>>>>>
>>>>>>>>
>>>>>>>>                
>>>>>>>>
>>>>>the
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>>>>>user's guide doesn't help much, could anyone explain me step by step
>>>>>>>>
>>>>>>>>
>>>>>>>>                
>>>>>>>>
>>>how
>>>
>>>
>>>      
>>>
>>>>>>>>                
>>>>>>>>
>>>>>to
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>>>>>set-up my system to use the new logger?
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>                
>>>>>>>>
>>>>>>>Cool, I'll have to look into monolog a bit.
>>>>>>>
>>>>>>>
>>>>>>>As Jose mentioned, you can just set a system property on the jvm
>>>>>>>
>>>>>>>
>>>>>>>              
>>>>>>>
>>>command
>>>
>>>
>>>      
>>>
>>>>>>>line:
>>>>>>>java -Dorg.apache.commons.logging.Log=your.log.class
>>>>>>>(described in the LogFactoryImpl javadoc)
>>>>>>>
>>>>>>>This is fine for debugging, but isn't very nice when building
>>>>>>>frameworks, etc. But from a quick peek at the code, it looks like you
>>>>>>>can also create a file "commons-logging.properties" and put it in the
>>>>>>>classpath, with these contents:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>              
>>>>>>>
>>>>org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.Log
>>>>        
>>>>
>F
>  
>
>>>>>          
>>>>>
>>>a
>>>
>>>
>>>      
>>>
>>>>>>            
>>>>>>
>>>>>ctoryImpl
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>>>>org.apache.commons.logging.Log=your.log.class
>>>>>>>
>>>>>>>And as a third option, it looks like you could define your own
>>>>>>>LogFactory subclass, and then specify it by creating a file:
>>>>>>>META-INF/services/org.apache.commons.logging.LogFactory
>>>>>>>with its first line being:
>>>>>>>your.logfactory.class
>>>>>>>
>>>>>>>
>>>>>>>I've only used the -D approach myself, so the above might be wrong.
>>>>>>>              
>>>>>>>
>As
>  
>
>>>>>>>always, the source code is the official and final documentation! The
>>>>>>>LogFactory and LogFactoryImpl classes are the ones that control all
>>>>>>>
>>>>>>>
>>>>>>>              
>>>>>>>
>>>this
>>>
>>>
>>>      
>>>
>>>>>>>behaviour.
>>>>>>>
>>>>>>>Regards,
>>>>>>>
>>>>>>>Simon
>>>>>>>
>>>>>>>
>>>>>>>---------------------------------------------------------------------
>>>>>>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>>>>>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>              
>>>>>>>
>>>>-------------------------------------------------------------------------
>>>>        
>>>>
>-
>  
>
>>>>>          
>>>>>
>>>>>>            
>>>>>>
>>>>>-----------------------------------------
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>>>Este correo electrónico y, en su caso, cualquier fichero anexo al
>>>>>>            
>>>>>>
>mismo,
>  
>
>>>>>>
>>>>>>
>>>>>>            
>>>>>>
>>>>>contiene información de carácter confidencial exclusivamente dirigida a
>>>>>
>>>>>
>>>>>          
>>>>>
>>>su
>>>
>>>
>>>      
>>>
>>>>>destinatario o destinatarios. Queda prohibida su divulgación, copia o
>>>>>distribución a terceros sin la previa autorización escrita de Indra. En
>>>>>
>>>>>
>>>>>          
>>>>>
>>>el
>>>
>>>
>>>      
>>>
>>>>>caso de haber recibido este correo electrónico por error, se ruega
>>>>>
>>>>>
>>>>>          
>>>>>
>>>notificar
>>>
>>>
>>>      
>>>
>>>>>inmediatamente esta circunstancia mediante reenvío a la dirección
>>>>>electrónica del remitente.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>>>The information in this e-mail and in any attachments is confidential
>>>>>>
>>>>>>
>>>>>>            
>>>>>>
>>>and
>>>
>>>
>>>      
>>>
>>>>>>            
>>>>>>
>>>>>solely for the attention and use of the named addressee(s). You are
>>>>>
>>>>>
>>>>>          
>>>>>
>>>hereby
>>>
>>>
>>>      
>>>
>>>>>notified that any dissemination, distribution or copy of this
>>>>>
>>>>>
>>>>>          
>>>>>
>>>communication
>>>
>>>
>>>      
>>>
>>>>>is prohibited without the prior written consent of Indra. If you have
>>>>>received this communication in error, please, notify the sender by
>>>>>          
>>>>>
>reply
>  
>
>>>>>e-mail
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>>>---------------------------------------------------------------------
>>>>>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>>>>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>            
>>>>>>
>>>>>---------------------------------------------------------------------
>>>>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>>>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>          
>>>>>
>>>--------------------------------------------------------------------------
>>>      
>>>
>>>>        
>>>>
>>>-----------------------------------------
>>>
>>>
>>>      
>>>
>>>>Este correo electrónico y, en su caso, cualquier fichero anexo al mismo,
>>>>
>>>>
>>>>        
>>>>
>>>contiene información de carácter confidencial exclusivamente dirigida a
>>>      
>>>
>su
>  
>
>>>destinatario o destinatarios. Queda prohibida su divulgación, copia o
>>>distribución a terceros sin la previa autorización escrita de Indra. En
>>>      
>>>
>el
>  
>
>>>caso de haber recibido este correo electrónico por error, se ruega
>>>      
>>>
>notificar
>  
>
>>>inmediatamente esta circunstancia mediante reenvío a la dirección
>>>electrónica del remitente.
>>>
>>>
>>>      
>>>
>>>>The information in this e-mail and in any attachments is confidential
>>>>        
>>>>
>and
>  
>
>>>>        
>>>>
>>>solely for the attention and use of the named addressee(s). You are
>>>      
>>>
>hereby
>  
>
>>>notified that any dissemination, distribution or copy of this
>>>      
>>>
>communication
>  
>
>>>is prohibited without the prior written consent of Indra. If you have
>>>received this communication in error, please, notify the sender by reply
>>>e-mail
>>>
>>>
>>>      
>>>
>>>>---------------------------------------------------------------------
>>>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>>>
>>>>
>>>>
>>>>        
>>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>>
>>>
>>>
>>>      
>>>
>>--------------------------------------------------------------------------
>>    
>>
>-----------------------------------------
>  
>
>>Este correo electrónico y, en su caso, cualquier fichero anexo al mismo,
>>    
>>
>contiene información de carácter confidencial exclusivamente dirigida a su
>destinatario o destinatarios. Queda prohibida su divulgación, copia o
>distribución a terceros sin la previa autorización escrita de Indra. En el
>caso de haber recibido este correo electrónico por error, se ruega notificar
>inmediatamente esta circunstancia mediante reenvío a la dirección
>electrónica del remitente.
>  
>
>>The information in this e-mail and in any attachments is confidential and
>>    
>>
>solely for the attention and use of the named addressee(s). You are hereby
>notified that any dissemination, distribution or copy of this communication
>is prohibited without the prior written consent of Indra. If you have
>received this communication in error, please, notify the sender by reply
>e-mail
>  
>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>  
>

-------------------------------------------------------------------------------------------------------------------
Este correo electrónico y, en su caso, cualquier fichero anexo al mismo, contiene información de carácter confidencial exclusivamente dirigida a su destinatario o destinatarios. Queda prohibida su divulgación, copia o distribución a terceros sin la previa autorización escrita de Indra. En el caso de haber recibido este correo electrónico por error, se ruega notificar inmediatamente esta circunstancia mediante reenvío a la dirección electrónica del remitente.

The information in this e-mail and in any attachments is confidential and solely for the attention and use of the named addressee(s). You are hereby notified that any dissemination, distribution or copy of this communication is prohibited without the prior written consent of Indra. If you have received this communication in error, please, notify the sender by reply e-mail

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [logging] How to get logging to use new Monolog subclass

Posted by Igor Smirnov <ig...@prozone.co.yu>.
As previously said, I had implemented this method. It seams like I am not
getting any exceptions. I start the Tomcat up, it reads trough the
common-logging.properties, where it should initialize my logger.
I checked both my class and the logs for exceptions and haven't found any.

----- Original Message -----
From: "José Antonio Pérez Testa" <ja...@indra.es>
To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
Sent: Wednesday, May 12, 2004 11:45 AM
Subject: Re: [logging] How to get logging to use new Monolog subclass


> Can you add the code for 'isMonologAvailable()' ?
>
> it should look like log4j's:
>     protected boolean isLog4JAvailable() {
>
>         try {
>             loadClass("org.apache.log4j.Logger");
>             loadClass("org.apache.commons.logging.impl.Log4JLogger");
>             return (true);
>         } catch (Throwable t) {
>             return (false);
>         }
>     }
> so if you can load the implementation you can use it!
>
> In any case, you must be catching some kind of exception in some place,
> could you give the exception printStackTrace() ???
>
> Igor Smirnov wrote:
>
> >I've been trying to make it run, but I keep getting log4j instead. I have
> >added to LogFactoryImpl.java.
> >
> >if ((logClassName == null) && isMonologAvailable()) {
> >            logClassName =
"org.apache.commons.logging.impl.MonologLogger";
> >        }
> >and isMonologAvailable() which returns true.
> >
> >Any ideas why it will not work? It seams like it falls back to log4j
(if?)
> >it doesn't find Monologs class.(?)
> >
> >Thanks,
> >Igor
> >
> >----- Original Message -----
> >From: "José Antonio Pérez Testa" <ja...@indra.es>
> >To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
> >Sent: Tuesday, May 11, 2004 12:16 PM
> >Subject: Re: [logging] How to get logging to use new Monolog subclass
> >
> >
> >
> >
> >>Well, now try this
> >>WEB_INF/classes/commons-logging.properties
> >>
> >>
> >>
>
>org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFa
c
> >toryImpl
> >
> >
>
>org.apache.commons.logging.Log=org.apache.commons.logging.impl.MonologLogge
r
> >
> >
> >>Igor Smirnov wrote:
> >>
> >>
> >>
> >>>Following instructions, I made Commons Logging use log4j in Tomcat.
> >>>Now, everything runs smoothly, but - I still need to configure Commons
> >>>Logging to use my new logger implementation:
> >>>org.apache.commons.logging.impl.MonologLogger
> >>>It is the implementation for Monolog (objectwebs project).
> >>>How does commong logging recognize custom loggers? Monolog uses it's
> >>>monolog.properties file to set up the logging events.
> >>>
> >>>Thank you
> >>>
> >>>----- Original Message -----
> >>>From: "José Antonio Pérez Testa" <ja...@indra.es>
> >>>To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
> >>>Sent: Monday, May 10, 2004 11:12 AM
> >>>Subject: Re: [logging] How to get logging to use new Monolog subclass
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>>By default Commons Logging uses Log4j implementation, if the libraries
> >>>>are available on the classpath you should be able to log to a Log4j
> >>>>implementation without no configuration (apart from log4j.properties
or
> >>>>equivalent xml file).
> >>>>I am writing logs to log4j with Commons Logging in many projects and
the
> >>>>only difficults I've found  were with AppServer precedence of
libraries.
> >>>>You should try to configure log4j implementation first, and when this
> >>>>implementation works give a try with Monolog
> >>>>
> >>>>
> >>>>Simon Kitching wrote:
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>>On Mon, 2004-05-10 at 20:22, Igor Smirnov wrote:
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>>Hollowing Simon's suggestion, I am posting the same question under
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>another
> >>>
> >>>
> >>>
> >>>
> >>>>>>Subject.
> >>>>>>
> >>>>>>And to be more specific: I am working tiwht Monolog logger that
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>implements
> >>>
> >>>
> >>>
> >>>
> >>>>>>and extends log4j functionality. I needed a new Log impl. in commons
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>logging
> >>>
> >>>
> >>>
> >>>
> >>>>>>to be able to use Monolog logger with tomcat.
> >>>>>>Hopefully this clears it up. And here's the first post:
> >>>>>>
> >>>>>>I've working with commons logging for the past week and have
> >>>>>>
> >>>>>>
> >implemented
> >
> >
> >>>>>>
> >>>>>>
> >>>a
> >>>
> >>>
> >>>
> >>>
> >>>>>>new logger within for my needs.
> >>>>>>Now, since I am not confortable with the whole commons package yet
and
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>the
> >>>
> >>>
> >>>
> >>>
> >>>>>>user's guide doesn't help much, could anyone explain me step by step
> >>>>>>
> >>>>>>
> >how
> >
> >
> >>>>>>
> >>>>>>
> >>>to
> >>>
> >>>
> >>>
> >>>
> >>>>>>set-up my system to use the new logger?
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>Cool, I'll have to look into monolog a bit.
> >>>>>
> >>>>>
> >>>>>As Jose mentioned, you can just set a system property on the jvm
> >>>>>
> >>>>>
> >command
> >
> >
> >>>>>line:
> >>>>>java -Dorg.apache.commons.logging.Log=your.log.class
> >>>>>(described in the LogFactoryImpl javadoc)
> >>>>>
> >>>>>This is fine for debugging, but isn't very nice when building
> >>>>>frameworks, etc. But from a quick peek at the code, it looks like you
> >>>>>can also create a file "commons-logging.properties" and put it in the
> >>>>>classpath, with these contents:
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
>
>>>org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.Log
F
> >>>
> >>>
> >a
> >
> >
> >>>>
> >>>>
> >>>ctoryImpl
> >>>
> >>>
> >>>
> >>>
> >>>>>org.apache.commons.logging.Log=your.log.class
> >>>>>
> >>>>>And as a third option, it looks like you could define your own
> >>>>>LogFactory subclass, and then specify it by creating a file:
> >>>>>META-INF/services/org.apache.commons.logging.LogFactory
> >>>>>with its first line being:
> >>>>>your.logfactory.class
> >>>>>
> >>>>>
> >>>>>I've only used the -D approach myself, so the above might be wrong.
As
> >>>>>always, the source code is the official and final documentation! The
> >>>>>LogFactory and LogFactoryImpl classes are the ones that control all
> >>>>>
> >>>>>
> >this
> >
> >
> >>>>>behaviour.
> >>>>>
> >>>>>Regards,
> >>>>>
> >>>>>Simon
> >>>>>
> >>>>>
> >>>>>---------------------------------------------------------------------
> >>>>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> >>>>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>
>
>>>-------------------------------------------------------------------------
-
> >>>
> >>>
> >>>>
> >>>>
> >>>-----------------------------------------
> >>>
> >>>
> >>>
> >>>
> >>>>Este correo electrónico y, en su caso, cualquier fichero anexo al
mismo,
> >>>>
> >>>>
> >>>>
> >>>>
> >>>contiene información de carácter confidencial exclusivamente dirigida a
> >>>
> >>>
> >su
> >
> >
> >>>destinatario o destinatarios. Queda prohibida su divulgación, copia o
> >>>distribución a terceros sin la previa autorización escrita de Indra. En
> >>>
> >>>
> >el
> >
> >
> >>>caso de haber recibido este correo electrónico por error, se ruega
> >>>
> >>>
> >notificar
> >
> >
> >>>inmediatamente esta circunstancia mediante reenvío a la dirección
> >>>electrónica del remitente.
> >>>
> >>>
> >>>
> >>>
> >>>>The information in this e-mail and in any attachments is confidential
> >>>>
> >>>>
> >and
> >
> >
> >>>>
> >>>>
> >>>solely for the attention and use of the named addressee(s). You are
> >>>
> >>>
> >hereby
> >
> >
> >>>notified that any dissemination, distribution or copy of this
> >>>
> >>>
> >communication
> >
> >
> >>>is prohibited without the prior written consent of Indra. If you have
> >>>received this communication in error, please, notify the sender by
reply
> >>>e-mail
> >>>
> >>>
> >>>
> >>>
> >>>>---------------------------------------------------------------------
> >>>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> >>>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>---------------------------------------------------------------------
> >>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> >>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >>>
> >>>
> >>>
> >>>
> >>>
>
>>--------------------------------------------------------------------------
> >>
> >>
> >-----------------------------------------
> >
> >
> >>Este correo electrónico y, en su caso, cualquier fichero anexo al mismo,
> >>
> >>
> >contiene información de carácter confidencial exclusivamente dirigida a
su
> >destinatario o destinatarios. Queda prohibida su divulgación, copia o
> >distribución a terceros sin la previa autorización escrita de Indra. En
el
> >caso de haber recibido este correo electrónico por error, se ruega
notificar
> >inmediatamente esta circunstancia mediante reenvío a la dirección
> >electrónica del remitente.
> >
> >
> >>The information in this e-mail and in any attachments is confidential
and
> >>
> >>
> >solely for the attention and use of the named addressee(s). You are
hereby
> >notified that any dissemination, distribution or copy of this
communication
> >is prohibited without the prior written consent of Indra. If you have
> >received this communication in error, please, notify the sender by reply
> >e-mail
> >
> >
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >>
> >>
> >>
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >
> >
> >
>
> --------------------------------------------------------------------------
-----------------------------------------
> Este correo electrónico y, en su caso, cualquier fichero anexo al mismo,
contiene información de carácter confidencial exclusivamente dirigida a su
destinatario o destinatarios. Queda prohibida su divulgación, copia o
distribución a terceros sin la previa autorización escrita de Indra. En el
caso de haber recibido este correo electrónico por error, se ruega notificar
inmediatamente esta circunstancia mediante reenvío a la dirección
electrónica del remitente.
>
> The information in this e-mail and in any attachments is confidential and
solely for the attention and use of the named addressee(s). You are hereby
notified that any dissemination, distribution or copy of this communication
is prohibited without the prior written consent of Indra. If you have
received this communication in error, please, notify the sender by reply
e-mail
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [logging] How to get logging to use new Monolog subclass

Posted by José Antonio Pérez Testa <ja...@indra.es>.
Can you add the code for 'isMonologAvailable()' ?

it should look like log4j's:
    protected boolean isLog4JAvailable() {

        try {
            loadClass("org.apache.log4j.Logger");
            loadClass("org.apache.commons.logging.impl.Log4JLogger");
            return (true);
        } catch (Throwable t) {
            return (false);
        }
    }
so if you can load the implementation you can use it!

In any case, you must be catching some kind of exception in some place, 
could you give the exception printStackTrace() ???

Igor Smirnov wrote:

>I've been trying to make it run, but I keep getting log4j instead. I have
>added to LogFactoryImpl.java.
>
>if ((logClassName == null) && isMonologAvailable()) {
>            logClassName = "org.apache.commons.logging.impl.MonologLogger";
>        }
>and isMonologAvailable() which returns true.
>
>Any ideas why it will not work? It seams like it falls back to log4j (if?)
>it doesn't find Monologs class.(?)
>
>Thanks,
>Igor
>
>----- Original Message -----
>From: "José Antonio Pérez Testa" <ja...@indra.es>
>To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
>Sent: Tuesday, May 11, 2004 12:16 PM
>Subject: Re: [logging] How to get logging to use new Monolog subclass
>
>
>  
>
>>Well, now try this
>>WEB_INF/classes/commons-logging.properties
>>
>>    
>>
>org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFac
>toryImpl
>  
>
>org.apache.commons.logging.Log=org.apache.commons.logging.impl.MonologLogger
>  
>
>>Igor Smirnov wrote:
>>
>>    
>>
>>>Following instructions, I made Commons Logging use log4j in Tomcat.
>>>Now, everything runs smoothly, but - I still need to configure Commons
>>>Logging to use my new logger implementation:
>>>org.apache.commons.logging.impl.MonologLogger
>>>It is the implementation for Monolog (objectwebs project).
>>>How does commong logging recognize custom loggers? Monolog uses it's
>>>monolog.properties file to set up the logging events.
>>>
>>>Thank you
>>>
>>>----- Original Message -----
>>>From: "José Antonio Pérez Testa" <ja...@indra.es>
>>>To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
>>>Sent: Monday, May 10, 2004 11:12 AM
>>>Subject: Re: [logging] How to get logging to use new Monolog subclass
>>>
>>>
>>>
>>>
>>>      
>>>
>>>>By default Commons Logging uses Log4j implementation, if the libraries
>>>>are available on the classpath you should be able to log to a Log4j
>>>>implementation without no configuration (apart from log4j.properties or
>>>>equivalent xml file).
>>>>I am writing logs to log4j with Commons Logging in many projects and the
>>>>only difficults I've found  were with AppServer precedence of libraries.
>>>>You should try to configure log4j implementation first, and when this
>>>>implementation works give a try with Monolog
>>>>
>>>>
>>>>Simon Kitching wrote:
>>>>
>>>>
>>>>
>>>>        
>>>>
>>>>>On Mon, 2004-05-10 at 20:22, Igor Smirnov wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>>>Hollowing Simon's suggestion, I am posting the same question under
>>>>>>
>>>>>>
>>>>>>            
>>>>>>
>>>another
>>>
>>>
>>>      
>>>
>>>>>>Subject.
>>>>>>
>>>>>>And to be more specific: I am working tiwht Monolog logger that
>>>>>>
>>>>>>
>>>>>>            
>>>>>>
>>>implements
>>>
>>>
>>>      
>>>
>>>>>>and extends log4j functionality. I needed a new Log impl. in commons
>>>>>>
>>>>>>
>>>>>>            
>>>>>>
>>>logging
>>>
>>>
>>>      
>>>
>>>>>>to be able to use Monolog logger with tomcat.
>>>>>>Hopefully this clears it up. And here's the first post:
>>>>>>
>>>>>>I've working with commons logging for the past week and have
>>>>>>            
>>>>>>
>implemented
>  
>
>>>>>>            
>>>>>>
>>>a
>>>
>>>
>>>      
>>>
>>>>>>new logger within for my needs.
>>>>>>Now, since I am not confortable with the whole commons package yet and
>>>>>>
>>>>>>
>>>>>>            
>>>>>>
>>>the
>>>
>>>
>>>      
>>>
>>>>>>user's guide doesn't help much, could anyone explain me step by step
>>>>>>            
>>>>>>
>how
>  
>
>>>>>>            
>>>>>>
>>>to
>>>
>>>
>>>      
>>>
>>>>>>set-up my system to use the new logger?
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>            
>>>>>>
>>>>>Cool, I'll have to look into monolog a bit.
>>>>>
>>>>>
>>>>>As Jose mentioned, you can just set a system property on the jvm
>>>>>          
>>>>>
>command
>  
>
>>>>>line:
>>>>>java -Dorg.apache.commons.logging.Log=your.log.class
>>>>>(described in the LogFactoryImpl javadoc)
>>>>>
>>>>>This is fine for debugging, but isn't very nice when building
>>>>>frameworks, etc. But from a quick peek at the code, it looks like you
>>>>>can also create a file "commons-logging.properties" and put it in the
>>>>>classpath, with these contents:
>>>>>
>>>>>
>>>>>
>>>>>          
>>>>>
>>>org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogF
>>>      
>>>
>a
>  
>
>>>>        
>>>>
>>>ctoryImpl
>>>
>>>
>>>      
>>>
>>>>>org.apache.commons.logging.Log=your.log.class
>>>>>
>>>>>And as a third option, it looks like you could define your own
>>>>>LogFactory subclass, and then specify it by creating a file:
>>>>>META-INF/services/org.apache.commons.logging.LogFactory
>>>>>with its first line being:
>>>>>your.logfactory.class
>>>>>
>>>>>
>>>>>I've only used the -D approach myself, so the above might be wrong. As
>>>>>always, the source code is the official and final documentation! The
>>>>>LogFactory and LogFactoryImpl classes are the ones that control all
>>>>>          
>>>>>
>this
>  
>
>>>>>behaviour.
>>>>>
>>>>>Regards,
>>>>>
>>>>>Simon
>>>>>
>>>>>
>>>>>---------------------------------------------------------------------
>>>>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>>>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>          
>>>>>
>>>--------------------------------------------------------------------------
>>>      
>>>
>>>>        
>>>>
>>>-----------------------------------------
>>>
>>>
>>>      
>>>
>>>>Este correo electrónico y, en su caso, cualquier fichero anexo al mismo,
>>>>
>>>>
>>>>        
>>>>
>>>contiene información de carácter confidencial exclusivamente dirigida a
>>>      
>>>
>su
>  
>
>>>destinatario o destinatarios. Queda prohibida su divulgación, copia o
>>>distribución a terceros sin la previa autorización escrita de Indra. En
>>>      
>>>
>el
>  
>
>>>caso de haber recibido este correo electrónico por error, se ruega
>>>      
>>>
>notificar
>  
>
>>>inmediatamente esta circunstancia mediante reenvío a la dirección
>>>electrónica del remitente.
>>>
>>>
>>>      
>>>
>>>>The information in this e-mail and in any attachments is confidential
>>>>        
>>>>
>and
>  
>
>>>>        
>>>>
>>>solely for the attention and use of the named addressee(s). You are
>>>      
>>>
>hereby
>  
>
>>>notified that any dissemination, distribution or copy of this
>>>      
>>>
>communication
>  
>
>>>is prohibited without the prior written consent of Indra. If you have
>>>received this communication in error, please, notify the sender by reply
>>>e-mail
>>>
>>>
>>>      
>>>
>>>>---------------------------------------------------------------------
>>>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>>>
>>>>
>>>>
>>>>        
>>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>>
>>>
>>>
>>>      
>>>
>>--------------------------------------------------------------------------
>>    
>>
>-----------------------------------------
>  
>
>>Este correo electrónico y, en su caso, cualquier fichero anexo al mismo,
>>    
>>
>contiene información de carácter confidencial exclusivamente dirigida a su
>destinatario o destinatarios. Queda prohibida su divulgación, copia o
>distribución a terceros sin la previa autorización escrita de Indra. En el
>caso de haber recibido este correo electrónico por error, se ruega notificar
>inmediatamente esta circunstancia mediante reenvío a la dirección
>electrónica del remitente.
>  
>
>>The information in this e-mail and in any attachments is confidential and
>>    
>>
>solely for the attention and use of the named addressee(s). You are hereby
>notified that any dissemination, distribution or copy of this communication
>is prohibited without the prior written consent of Indra. If you have
>received this communication in error, please, notify the sender by reply
>e-mail
>  
>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>  
>

-------------------------------------------------------------------------------------------------------------------
Este correo electrónico y, en su caso, cualquier fichero anexo al mismo, contiene información de carácter confidencial exclusivamente dirigida a su destinatario o destinatarios. Queda prohibida su divulgación, copia o distribución a terceros sin la previa autorización escrita de Indra. En el caso de haber recibido este correo electrónico por error, se ruega notificar inmediatamente esta circunstancia mediante reenvío a la dirección electrónica del remitente.

The information in this e-mail and in any attachments is confidential and solely for the attention and use of the named addressee(s). You are hereby notified that any dissemination, distribution or copy of this communication is prohibited without the prior written consent of Indra. If you have received this communication in error, please, notify the sender by reply e-mail

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [logging] How to get logging to use new Monolog subclass

Posted by Igor Smirnov <ig...@prozone.co.yu>.
I've been trying to make it run, but I keep getting log4j instead. I have
added to LogFactoryImpl.java.

if ((logClassName == null) && isMonologAvailable()) {
            logClassName = "org.apache.commons.logging.impl.MonologLogger";
        }
and isMonologAvailable() which returns true.

Any ideas why it will not work? It seams like it falls back to log4j (if?)
it doesn't find Monologs class.(?)

Thanks,
Igor

----- Original Message -----
From: "José Antonio Pérez Testa" <ja...@indra.es>
To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
Sent: Tuesday, May 11, 2004 12:16 PM
Subject: Re: [logging] How to get logging to use new Monolog subclass


> Well, now try this
> WEB_INF/classes/commons-logging.properties
>
org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFac
toryImpl
>
org.apache.commons.logging.Log=org.apache.commons.logging.impl.MonologLogger
>
> Igor Smirnov wrote:
>
> >Following instructions, I made Commons Logging use log4j in Tomcat.
> >Now, everything runs smoothly, but - I still need to configure Commons
> >Logging to use my new logger implementation:
> >org.apache.commons.logging.impl.MonologLogger
> >It is the implementation for Monolog (objectwebs project).
> >How does commong logging recognize custom loggers? Monolog uses it's
> >monolog.properties file to set up the logging events.
> >
> >Thank you
> >
> >----- Original Message -----
> >From: "José Antonio Pérez Testa" <ja...@indra.es>
> >To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
> >Sent: Monday, May 10, 2004 11:12 AM
> >Subject: Re: [logging] How to get logging to use new Monolog subclass
> >
> >
> >
> >
> >>By default Commons Logging uses Log4j implementation, if the libraries
> >>are available on the classpath you should be able to log to a Log4j
> >>implementation without no configuration (apart from log4j.properties or
> >>equivalent xml file).
> >>I am writing logs to log4j with Commons Logging in many projects and the
> >>only difficults I've found  were with AppServer precedence of libraries.
> >>You should try to configure log4j implementation first, and when this
> >>implementation works give a try with Monolog
> >>
> >>
> >>Simon Kitching wrote:
> >>
> >>
> >>
> >>>On Mon, 2004-05-10 at 20:22, Igor Smirnov wrote:
> >>>
> >>>
> >>>
> >>>
> >>>>Hollowing Simon's suggestion, I am posting the same question under
> >>>>
> >>>>
> >another
> >
> >
> >>>>Subject.
> >>>>
> >>>>And to be more specific: I am working tiwht Monolog logger that
> >>>>
> >>>>
> >implements
> >
> >
> >>>>and extends log4j functionality. I needed a new Log impl. in commons
> >>>>
> >>>>
> >logging
> >
> >
> >>>>to be able to use Monolog logger with tomcat.
> >>>>Hopefully this clears it up. And here's the first post:
> >>>>
> >>>>I've working with commons logging for the past week and have
implemented
> >>>>
> >>>>
> >a
> >
> >
> >>>>new logger within for my needs.
> >>>>Now, since I am not confortable with the whole commons package yet and
> >>>>
> >>>>
> >the
> >
> >
> >>>>user's guide doesn't help much, could anyone explain me step by step
how
> >>>>
> >>>>
> >to
> >
> >
> >>>>set-up my system to use the new logger?
> >>>>
> >>>>
> >>>>
> >>>>
> >>>Cool, I'll have to look into monolog a bit.
> >>>
> >>>
> >>>As Jose mentioned, you can just set a system property on the jvm
command
> >>>line:
> >>> java -Dorg.apache.commons.logging.Log=your.log.class
> >>>(described in the LogFactoryImpl javadoc)
> >>>
> >>>This is fine for debugging, but isn't very nice when building
> >>>frameworks, etc. But from a quick peek at the code, it looks like you
> >>>can also create a file "commons-logging.properties" and put it in the
> >>>classpath, with these contents:
> >>>
> >>>
> >>>
>
>>org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogF
a
> >>
> >>
> >ctoryImpl
> >
> >
> >>>org.apache.commons.logging.Log=your.log.class
> >>>
> >>>And as a third option, it looks like you could define your own
> >>>LogFactory subclass, and then specify it by creating a file:
> >>> META-INF/services/org.apache.commons.logging.LogFactory
> >>>with its first line being:
> >>> your.logfactory.class
> >>>
> >>>
> >>>I've only used the -D approach myself, so the above might be wrong. As
> >>>always, the source code is the official and final documentation! The
> >>>LogFactory and LogFactoryImpl classes are the ones that control all
this
> >>>behaviour.
> >>>
> >>>Regards,
> >>>
> >>>Simon
> >>>
> >>>
> >>>---------------------------------------------------------------------
> >>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> >>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >>>
> >>>
> >>>
> >>>
> >>>
>
>>--------------------------------------------------------------------------
> >>
> >>
> >-----------------------------------------
> >
> >
> >>Este correo electrónico y, en su caso, cualquier fichero anexo al mismo,
> >>
> >>
> >contiene información de carácter confidencial exclusivamente dirigida a
su
> >destinatario o destinatarios. Queda prohibida su divulgación, copia o
> >distribución a terceros sin la previa autorización escrita de Indra. En
el
> >caso de haber recibido este correo electrónico por error, se ruega
notificar
> >inmediatamente esta circunstancia mediante reenvío a la dirección
> >electrónica del remitente.
> >
> >
> >>The information in this e-mail and in any attachments is confidential
and
> >>
> >>
> >solely for the attention and use of the named addressee(s). You are
hereby
> >notified that any dissemination, distribution or copy of this
communication
> >is prohibited without the prior written consent of Indra. If you have
> >received this communication in error, please, notify the sender by reply
> >e-mail
> >
> >
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >>
> >>
> >>
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >
> >
> >
>
> --------------------------------------------------------------------------
-----------------------------------------
> Este correo electrónico y, en su caso, cualquier fichero anexo al mismo,
contiene información de carácter confidencial exclusivamente dirigida a su
destinatario o destinatarios. Queda prohibida su divulgación, copia o
distribución a terceros sin la previa autorización escrita de Indra. En el
caso de haber recibido este correo electrónico por error, se ruega notificar
inmediatamente esta circunstancia mediante reenvío a la dirección
electrónica del remitente.
>
> The information in this e-mail and in any attachments is confidential and
solely for the attention and use of the named addressee(s). You are hereby
notified that any dissemination, distribution or copy of this communication
is prohibited without the prior written consent of Indra. If you have
received this communication in error, please, notify the sender by reply
e-mail
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [logging] How to get logging to use new Monolog subclass

Posted by José Antonio Pérez Testa <ja...@indra.es>.
Well, now try this
WEB_INF/classes/commons-logging.properties
org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFactoryImpl
org.apache.commons.logging.Log=org.apache.commons.logging.impl.MonologLogger

Igor Smirnov wrote:

>Following instructions, I made Commons Logging use log4j in Tomcat.
>Now, everything runs smoothly, but - I still need to configure Commons
>Logging to use my new logger implementation:
>org.apache.commons.logging.impl.MonologLogger
>It is the implementation for Monolog (objectwebs project).
>How does commong logging recognize custom loggers? Monolog uses it's
>monolog.properties file to set up the logging events.
>
>Thank you
>
>----- Original Message -----
>From: "José Antonio Pérez Testa" <ja...@indra.es>
>To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
>Sent: Monday, May 10, 2004 11:12 AM
>Subject: Re: [logging] How to get logging to use new Monolog subclass
>
>
>  
>
>>By default Commons Logging uses Log4j implementation, if the libraries
>>are available on the classpath you should be able to log to a Log4j
>>implementation without no configuration (apart from log4j.properties or
>>equivalent xml file).
>>I am writing logs to log4j with Commons Logging in many projects and the
>>only difficults I've found  were with AppServer precedence of libraries.
>>You should try to configure log4j implementation first, and when this
>>implementation works give a try with Monolog
>>
>>
>>Simon Kitching wrote:
>>
>>    
>>
>>>On Mon, 2004-05-10 at 20:22, Igor Smirnov wrote:
>>>
>>>
>>>      
>>>
>>>>Hollowing Simon's suggestion, I am posting the same question under
>>>>        
>>>>
>another
>  
>
>>>>Subject.
>>>>
>>>>And to be more specific: I am working tiwht Monolog logger that
>>>>        
>>>>
>implements
>  
>
>>>>and extends log4j functionality. I needed a new Log impl. in commons
>>>>        
>>>>
>logging
>  
>
>>>>to be able to use Monolog logger with tomcat.
>>>>Hopefully this clears it up. And here's the first post:
>>>>
>>>>I've working with commons logging for the past week and have implemented
>>>>        
>>>>
>a
>  
>
>>>>new logger within for my needs.
>>>>Now, since I am not confortable with the whole commons package yet and
>>>>        
>>>>
>the
>  
>
>>>>user's guide doesn't help much, could anyone explain me step by step how
>>>>        
>>>>
>to
>  
>
>>>>set-up my system to use the new logger?
>>>>
>>>>
>>>>        
>>>>
>>>Cool, I'll have to look into monolog a bit.
>>>
>>>
>>>As Jose mentioned, you can just set a system property on the jvm command
>>>line:
>>> java -Dorg.apache.commons.logging.Log=your.log.class
>>>(described in the LogFactoryImpl javadoc)
>>>
>>>This is fine for debugging, but isn't very nice when building
>>>frameworks, etc. But from a quick peek at the code, it looks like you
>>>can also create a file "commons-logging.properties" and put it in the
>>>classpath, with these contents:
>>>
>>>      
>>>
>>org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFa
>>    
>>
>ctoryImpl
>  
>
>>>org.apache.commons.logging.Log=your.log.class
>>>
>>>And as a third option, it looks like you could define your own
>>>LogFactory subclass, and then specify it by creating a file:
>>> META-INF/services/org.apache.commons.logging.LogFactory
>>>with its first line being:
>>> your.logfactory.class
>>>
>>>
>>>I've only used the -D approach myself, so the above might be wrong. As
>>>always, the source code is the official and final documentation! The
>>>LogFactory and LogFactoryImpl classes are the ones that control all this
>>>behaviour.
>>>
>>>Regards,
>>>
>>>Simon
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>>
>>>
>>>
>>>      
>>>
>>--------------------------------------------------------------------------
>>    
>>
>-----------------------------------------
>  
>
>>Este correo electrónico y, en su caso, cualquier fichero anexo al mismo,
>>    
>>
>contiene información de carácter confidencial exclusivamente dirigida a su
>destinatario o destinatarios. Queda prohibida su divulgación, copia o
>distribución a terceros sin la previa autorización escrita de Indra. En el
>caso de haber recibido este correo electrónico por error, se ruega notificar
>inmediatamente esta circunstancia mediante reenvío a la dirección
>electrónica del remitente.
>  
>
>>The information in this e-mail and in any attachments is confidential and
>>    
>>
>solely for the attention and use of the named addressee(s). You are hereby
>notified that any dissemination, distribution or copy of this communication
>is prohibited without the prior written consent of Indra. If you have
>received this communication in error, please, notify the sender by reply
>e-mail
>  
>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>  
>

-------------------------------------------------------------------------------------------------------------------
Este correo electrónico y, en su caso, cualquier fichero anexo al mismo, contiene información de carácter confidencial exclusivamente dirigida a su destinatario o destinatarios. Queda prohibida su divulgación, copia o distribución a terceros sin la previa autorización escrita de Indra. En el caso de haber recibido este correo electrónico por error, se ruega notificar inmediatamente esta circunstancia mediante reenvío a la dirección electrónica del remitente.

The information in this e-mail and in any attachments is confidential and solely for the attention and use of the named addressee(s). You are hereby notified that any dissemination, distribution or copy of this communication is prohibited without the prior written consent of Indra. If you have received this communication in error, please, notify the sender by reply e-mail

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [logging] How to get logging to use new Monolog subclass

Posted by Igor Smirnov <ig...@prozone.co.yu>.
Following instructions, I made Commons Logging use log4j in Tomcat.
Now, everything runs smoothly, but - I still need to configure Commons
Logging to use my new logger implementation:
org.apache.commons.logging.impl.MonologLogger
It is the implementation for Monolog (objectwebs project).
How does commong logging recognize custom loggers? Monolog uses it's
monolog.properties file to set up the logging events.

Thank you

----- Original Message -----
From: "José Antonio Pérez Testa" <ja...@indra.es>
To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
Sent: Monday, May 10, 2004 11:12 AM
Subject: Re: [logging] How to get logging to use new Monolog subclass


> By default Commons Logging uses Log4j implementation, if the libraries
> are available on the classpath you should be able to log to a Log4j
> implementation without no configuration (apart from log4j.properties or
> equivalent xml file).
> I am writing logs to log4j with Commons Logging in many projects and the
> only difficults I've found  were with AppServer precedence of libraries.
> You should try to configure log4j implementation first, and when this
> implementation works give a try with Monolog
>
>
> Simon Kitching wrote:
>
> >On Mon, 2004-05-10 at 20:22, Igor Smirnov wrote:
> >
> >
> >>Hollowing Simon's suggestion, I am posting the same question under
another
> >>Subject.
> >>
> >>And to be more specific: I am working tiwht Monolog logger that
implements
> >>and extends log4j functionality. I needed a new Log impl. in commons
logging
> >>to be able to use Monolog logger with tomcat.
> >>Hopefully this clears it up. And here's the first post:
> >>
> >>I've working with commons logging for the past week and have implemented
a
> >>new logger within for my needs.
> >>Now, since I am not confortable with the whole commons package yet and
the
> >>user's guide doesn't help much, could anyone explain me step by step how
to
> >>set-up my system to use the new logger?
> >>
> >>
> >
> >Cool, I'll have to look into monolog a bit.
> >
> >
> >As Jose mentioned, you can just set a system property on the jvm command
> >line:
> >  java -Dorg.apache.commons.logging.Log=your.log.class
> >(described in the LogFactoryImpl javadoc)
> >
> >This is fine for debugging, but isn't very nice when building
> >frameworks, etc. But from a quick peek at the code, it looks like you
> >can also create a file "commons-logging.properties" and put it in the
> >classpath, with these contents:
> >
>
>org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFa
ctoryImpl
> >org.apache.commons.logging.Log=your.log.class
> >
> >And as a third option, it looks like you could define your own
> >LogFactory subclass, and then specify it by creating a file:
> >  META-INF/services/org.apache.commons.logging.LogFactory
> >with its first line being:
> >  your.logfactory.class
> >
> >
> >I've only used the -D approach myself, so the above might be wrong. As
> >always, the source code is the official and final documentation! The
> >LogFactory and LogFactoryImpl classes are the ones that control all this
> >behaviour.
> >
> >Regards,
> >
> >Simon
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >
> >
> >
>
> --------------------------------------------------------------------------
-----------------------------------------
> Este correo electrónico y, en su caso, cualquier fichero anexo al mismo,
contiene información de carácter confidencial exclusivamente dirigida a su
destinatario o destinatarios. Queda prohibida su divulgación, copia o
distribución a terceros sin la previa autorización escrita de Indra. En el
caso de haber recibido este correo electrónico por error, se ruega notificar
inmediatamente esta circunstancia mediante reenvío a la dirección
electrónica del remitente.
>
> The information in this e-mail and in any attachments is confidential and
solely for the attention and use of the named addressee(s). You are hereby
notified that any dissemination, distribution or copy of this communication
is prohibited without the prior written consent of Indra. If you have
received this communication in error, please, notify the sender by reply
e-mail
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [logging] How to get logging to use new Monolog subclass

Posted by Igor Smirnov <ig...@prozone.co.yu>.
Thank you!

----- Original Message -----
From: "José Antonio Pérez Testa" <ja...@indra.es>
To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
Sent: Monday, May 10, 2004 6:14 PM
Subject: Re: [logging] How to get logging to use new Monolog subclass


> I'm using jakarta-tomcat-4.1.12-LE with java j2sdk1.4.1_02
> In my WEB_INF/lib : (maybe some of the libraries are innecesary ... )
>
>     commons-collections-2.0.jar
>     commons-logging-1.0.jar
>     servletapi-2.3.jar
>     xalan.jar
>     log4j.jar
>     xerces.jar
>     xml-apis-2.0.0.jar
>
> in my WEB-INF/classes/log4j.properties
>
>     logs_path=/tmp/logs
>
>     log4j.rootCategory=debug,Raiz,stdout
>
>     log4j.appender.stdout=org.apache.log4j.ConsoleAppender
>     log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
>     log4j.appender.stdout.layout.ConversionPattern=%d [%5p %c] Console-
%m%n
>
>     log4j.appender.Raiz=org.apache.log4j.RollingFileAppender
>     log4j.appender.Raiz.File=${logs_path}/logFile.log
>     log4j.appender.Raiz.layout=org.apache.log4j.PatternLayout
>     log4j.appender.Raiz.MaxBackupIndex=1
>     log4j.appender.Raiz.MaxFileSize=100MB
>     log4j.appender.Raiz.layout.ConversionPattern=%t %d  [%5p %c] - %m%n
>
> and that's all friends!!
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [logging] How to get logging to use new Monolog subclass

Posted by José Antonio Pérez Testa <ja...@indra.es>.
I'm using jakarta-tomcat-4.1.12-LE with java j2sdk1.4.1_02
In my WEB_INF/lib : (maybe some of the libraries are innecesary ... )

    commons-collections-2.0.jar       
    commons-logging-1.0.jar           
    servletapi-2.3.jar
    xalan.jar
    log4j.jar
    xerces.jar
    xml-apis-2.0.0.jar

in my WEB-INF/classes/log4j.properties

    logs_path=/tmp/logs

    log4j.rootCategory=debug,Raiz,stdout

    log4j.appender.stdout=org.apache.log4j.ConsoleAppender
    log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
    log4j.appender.stdout.layout.ConversionPattern=%d [%5p %c] Console- %m%n

    log4j.appender.Raiz=org.apache.log4j.RollingFileAppender
    log4j.appender.Raiz.File=${logs_path}/logFile.log
    log4j.appender.Raiz.layout=org.apache.log4j.PatternLayout
    log4j.appender.Raiz.MaxBackupIndex=1
    log4j.appender.Raiz.MaxFileSize=100MB
    log4j.appender.Raiz.layout.ConversionPattern=%t %d  [%5p %c] - %m%n

and that's all friends!!



Igor Smirnov wrote:

>Are you using commons logging with Tomcat? Any hints how to set up Tomcat to
>use commons logging?
>
>Best regards,
>Igor.
>
>----- Original Message -----
>From: "José Antonio Pérez Testa" <ja...@indra.es>
>To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
>Sent: Monday, May 10, 2004 11:12 AM
>Subject: Re: [logging] How to get logging to use new Monolog subclass
>
>
>  
>
>>By default Commons Logging uses Log4j implementation, if the libraries
>>are available on the classpath you should be able to log to a Log4j
>>implementation without no configuration (apart from log4j.properties or
>>equivalent xml file).
>>I am writing logs to log4j with Commons Logging in many projects and the
>>only difficults I've found  were with AppServer precedence of libraries.
>>You should try to configure log4j implementation first, and when this
>>implementation works give a try with Monolog
>>
>>
>>Simon Kitching wrote:
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>  
>

-------------------------------------------------------------------------------------------------------------------
Este correo electrónico y, en su caso, cualquier fichero anexo al mismo, contiene información de carácter confidencial exclusivamente dirigida a su destinatario o destinatarios. Queda prohibida su divulgación, copia o distribución a terceros sin la previa autorización escrita de Indra. En el caso de haber recibido este correo electrónico por error, se ruega notificar inmediatamente esta circunstancia mediante reenvío a la dirección electrónica del remitente.

The information in this e-mail and in any attachments is confidential and solely for the attention and use of the named addressee(s). You are hereby notified that any dissemination, distribution or copy of this communication is prohibited without the prior written consent of Indra. If you have received this communication in error, please, notify the sender by reply e-mail

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [logging] How to get logging to use new Monolog subclass

Posted by Igor Smirnov <ig...@prozone.co.yu>.
Are you using commons logging with Tomcat? Any hints how to set up Tomcat to
use commons logging?

Best regards,
Igor.

----- Original Message -----
From: "José Antonio Pérez Testa" <ja...@indra.es>
To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
Sent: Monday, May 10, 2004 11:12 AM
Subject: Re: [logging] How to get logging to use new Monolog subclass


> By default Commons Logging uses Log4j implementation, if the libraries
> are available on the classpath you should be able to log to a Log4j
> implementation without no configuration (apart from log4j.properties or
> equivalent xml file).
> I am writing logs to log4j with Commons Logging in many projects and the
> only difficults I've found  were with AppServer precedence of libraries.
> You should try to configure log4j implementation first, and when this
> implementation works give a try with Monolog
>
>
> Simon Kitching wrote:


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [logging] How to get logging to use new Monolog subclass

Posted by José Antonio Pérez Testa <ja...@indra.es>.
By default Commons Logging uses Log4j implementation, if the libraries 
are available on the classpath you should be able to log to a Log4j 
implementation without no configuration (apart from log4j.properties or 
equivalent xml file).
I am writing logs to log4j with Commons Logging in many projects and the 
only difficults I've found  were with AppServer precedence of libraries.
You should try to configure log4j implementation first, and when this 
implementation works give a try with Monolog


Simon Kitching wrote:

>On Mon, 2004-05-10 at 20:22, Igor Smirnov wrote:
>  
>
>>Hollowing Simon's suggestion, I am posting the same question under another
>>Subject.
>>
>>And to be more specific: I am working tiwht Monolog logger that implements
>>and extends log4j functionality. I needed a new Log impl. in commons logging
>>to be able to use Monolog logger with tomcat.
>>Hopefully this clears it up. And here's the first post:
>>
>>I've working with commons logging for the past week and have implemented a
>>new logger within for my needs.
>>Now, since I am not confortable with the whole commons package yet and the
>>user's guide doesn't help much, could anyone explain me step by step how to
>>set-up my system to use the new logger?
>>    
>>
>
>Cool, I'll have to look into monolog a bit.
>
>
>As Jose mentioned, you can just set a system property on the jvm command
>line:
>  java -Dorg.apache.commons.logging.Log=your.log.class
>(described in the LogFactoryImpl javadoc)
>
>This is fine for debugging, but isn't very nice when building
>frameworks, etc. But from a quick peek at the code, it looks like you
>can also create a file "commons-logging.properties" and put it in the
>classpath, with these contents:
>
>org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFactoryImpl
>org.apache.commons.logging.Log=your.log.class
>
>And as a third option, it looks like you could define your own
>LogFactory subclass, and then specify it by creating a file:
>  META-INF/services/org.apache.commons.logging.LogFactory
>with its first line being:
>  your.logfactory.class
>
>
>I've only used the -D approach myself, so the above might be wrong. As
>always, the source code is the official and final documentation! The
>LogFactory and LogFactoryImpl classes are the ones that control all this
>behaviour.
>
>Regards,
>
>Simon
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>  
>

-------------------------------------------------------------------------------------------------------------------
Este correo electrónico y, en su caso, cualquier fichero anexo al mismo, contiene información de carácter confidencial exclusivamente dirigida a su destinatario o destinatarios. Queda prohibida su divulgación, copia o distribución a terceros sin la previa autorización escrita de Indra. En el caso de haber recibido este correo electrónico por error, se ruega notificar inmediatamente esta circunstancia mediante reenvío a la dirección electrónica del remitente.

The information in this e-mail and in any attachments is confidential and solely for the attention and use of the named addressee(s). You are hereby notified that any dissemination, distribution or copy of this communication is prohibited without the prior written consent of Indra. If you have received this communication in error, please, notify the sender by reply e-mail

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [logging] How to get logging to use new Monolog subclass

Posted by Simon Kitching <si...@ecnetwork.co.nz>.
On Mon, 2004-05-10 at 20:22, Igor Smirnov wrote:
> Hollowing Simon's suggestion, I am posting the same question under another
> Subject.
> 
> And to be more specific: I am working tiwht Monolog logger that implements
> and extends log4j functionality. I needed a new Log impl. in commons logging
> to be able to use Monolog logger with tomcat.
> Hopefully this clears it up. And here's the first post:
> 
> I've working with commons logging for the past week and have implemented a
> new logger within for my needs.
> Now, since I am not confortable with the whole commons package yet and the
> user's guide doesn't help much, could anyone explain me step by step how to
> set-up my system to use the new logger?

Cool, I'll have to look into monolog a bit.


As Jose mentioned, you can just set a system property on the jvm command
line:
  java -Dorg.apache.commons.logging.Log=your.log.class
(described in the LogFactoryImpl javadoc)

This is fine for debugging, but isn't very nice when building
frameworks, etc. But from a quick peek at the code, it looks like you
can also create a file "commons-logging.properties" and put it in the
classpath, with these contents:

org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFactoryImpl
org.apache.commons.logging.Log=your.log.class

And as a third option, it looks like you could define your own
LogFactory subclass, and then specify it by creating a file:
  META-INF/services/org.apache.commons.logging.LogFactory
with its first line being:
  your.logfactory.class


I've only used the -D approach myself, so the above might be wrong. As
always, the source code is the official and final documentation! The
LogFactory and LogFactoryImpl classes are the ones that control all this
behaviour.

Regards,

Simon


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


[logging] How to get logging to use new Monolog subclass

Posted by Igor Smirnov <ig...@prozone.co.yu>.
Hollowing Simon's suggestion, I am posting the same question under another
Subject.

And to be more specific: I am working tiwht Monolog logger that implements
and extends log4j functionality. I needed a new Log impl. in commons logging
to be able to use Monolog logger with tomcat.
Hopefully this clears it up. And here's the first post:

I've working with commons logging for the past week and have implemented a
new logger within for my needs.
Now, since I am not confortable with the whole commons package yet and the
user's guide doesn't help much, could anyone explain me step by step how to
set-up my system to use the new logger?

Thanks,
Igor.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: Monolog help

Posted by Simon Kitching <si...@ecnetwork.co.nz>.
On Mon, 2004-05-10 at 19:58, Igor Smirnov wrote:
> Hi,
> 
> This is my first time posting here! :)
> I've working with commons logging for the past week and have implemented a new logger within for my needs.
> Now, since I am not confortable with the whole commons package yet and the user's guide doesn't help much, could anyone explain me step by step how to set-up my system to use the new logger?


Hi Igor, 

Welcome to commons-user.

I presume by "implemented a new logger" that you have implemented a
subclass of org.apache.commons.logging.Log (which we commonly abbreviate
like o.a.c.l.Log)?

And that this new class forms a bridge to some type of logging system
that commons-logging doesn't yet support?

What logging system exactly is this?

One suggestion: using a good subject for your email will make it more
likely that you get a good response. You could possibly improve on the
one above ;-). 

Note also that because the commons email list is shared between a bunch
of often unrelated projects we usually put the particular
project/library in brackets at the start of the subject, eg
  [logging] How to get logging to use new Log subclass


Regards,

Simon



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: Monolog help

Posted by José Antonio Pérez Testa <ja...@indra.es>.
I'm just copying from a recent message from Simon Kitching ....

FYI, you don't need to add any code to enable basic commons logging;
you can pass these command-line options to the JVM (NB: not tested!):

 java \  
  -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog
  ....

Just especify your implementation instead of SimpleLog

Igor Smirnov wrote:

>Hi,
>
>This is my first time posting here! :)
>I've working with commons logging for the past week and have implemented a new logger within for my needs.
>Now, since I am not confortable with the whole commons package yet and the user's guide doesn't help much, could anyone explain me step by step how to set-up my system to use the new logger?
>
>Thanks,
>Igor.
>  
>

-------------------------------------------------------------------------------------------------------------------
Este correo electr�nico y, en su caso, cualquier fichero anexo al mismo, contiene informaci�n de car�cter confidencial exclusivamente dirigida a su destinatario o destinatarios. Queda prohibida su divulgaci�n, copia o distribuci�n a terceros sin la previa autorizaci�n escrita de Indra. En el caso de haber recibido este correo electr�nico por error, se ruega notificar inmediatamente esta circunstancia mediante reenv�o a la direcci�n electr�nica del remitente.

The information in this e-mail and in any attachments is confidential and solely for the attention and use of the named addressee(s). You are hereby notified that any dissemination, distribution or copy of this communication is prohibited without the prior written consent of Indra. If you have received this communication in error, please, notify the sender by reply e-mail

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org