You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by Eugeny N Dzhurinsky <bo...@marka.net.ua> on 2003/01/13 12:13:09 UTC

Question about logging service

I'm using Log class in some of my business objects.
I need to test these classes.
But i don't want to show debug info with the System.out.println etc. I
want to use Log class as it defined by turbine.
The logging service is initialized during turbine servlet statup, but when
testing i can't to perform startup of turbine servoce, so logging service
is not initialized too. And i'm getting error

org.apache.turbine.services.InstantiationException: ServiceBroker: unknown
service LoggingService requested

so how can i initialize the logging service without Turbine startup?

Eugeny N. Dzhurinsky                          programmer
________________________________________________________
Inet dept., MARKA Ltd,               Zaporozhye, Ukraine
Tel: +380(612)131123,           Tel/Fax: +380(612)131124
E-mail: bofh@marka.net.ua         http://www.marka.zp.ua

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Question about logging service

Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
Eugeny N Dzhurinsky <bo...@marka.net.ua> writes:

>I'm using Log class in some of my business objects.
>I need to test these classes.
>But i don't want to show debug info with the System.out.println etc. I
>want to use Log class as it defined by turbine.
>The logging service is initialized during turbine servlet statup, but when
>testing i can't to perform startup of turbine servoce, so logging service
>is not initialized too. And i'm getting error

>org.apache.turbine.services.InstantiationException: ServiceBroker: unknown
>service LoggingService requested

Which turbine are you using? 2.2 or the CVS? If you're using the CVS,
I did check some information about how to do this post-2.2 with
commons-logging into the CVS on saturday/sunday.

In a nutshell. You forget about the Logging Service, and get a log
object like this:

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

private Log log = LogFactory.getLog("your.logger.facility");

and use log.debug("xxx");   // Please not the lowercase "l" on log

Then you configure your.logger.facility using Log4j.properties

	Regards
		Henning

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen       -- Geschaeftsfuehrer
INTERMETA - Gesellschaft fuer Mehrwertdienste mbH     hps@intermeta.de

Am Schwabachgrund 22  Fon.: 09131 / 50654-0   info@intermeta.de
D-91054 Buckenhof     Fax.: 09131 / 50654-20   

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Question about logging service

Posted by "Jeffrey D. Brekke" <jb...@wi.rr.com>.
It may not be exactly what you are looking for but has worked ok for us 
for quite some time, you could start Turbine in standalone mode.
 
http://jakarta.apache.org/turbine/tdk/application-testing.html


On Mon, 13 Jan 2003, Eugeny N Dzhurinsky wrote:

> 
> I'm using Log class in some of my business objects.
> I need to test these classes.
> But i don't want to show debug info with the System.out.println etc. I
> want to use Log class as it defined by turbine.
> The logging service is initialized during turbine servlet statup, but when
> testing i can't to perform startup of turbine servoce, so logging service
> is not initialized too. And i'm getting error
> 
> org.apache.turbine.services.InstantiationException: ServiceBroker: unknown
> service LoggingService requested
> 
> so how can i initialize the logging service without Turbine startup?
> 
> Eugeny N. Dzhurinsky                          programmer
> ________________________________________________________
> Inet dept., MARKA Ltd,               Zaporozhye, Ukraine
> Tel: +380(612)131123,           Tel/Fax: +380(612)131124
> E-mail: bofh@marka.net.ua         http://www.marka.zp.ua
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 

-- 
=====================================================================
Jeffrey D. Brekke                                   jbrekke@wi.rr.com
Wisconsin,  USA                                     brekke@apache.org
                                                    ekkerbj@yahoo.com



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>