You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by rainer juenger <ja...@projektinter.net> on 2002/07/15 19:36:04 UTC

Dont get it: Logging

Hi,

need a hint.
Struts is using the commons Logging.

private Log log =
        LogFactory.getLog("org.apache.struts.webapp.Example");

1)
Where actually can I find the log file??
It should be where it is configured in the package org.apache.commons.logging
configured in commons-logging.properties
But there is no propertie-file.

2)
            if (log.isDebugEnabled()) {
                log.debug(" User is not logged on in session "
                          + session.getId());
            }

Why is that? log.debug("something") would do? Is it for speeding up??

thanks, Rainer



validator example needed

Posted by Javier Muguruza <jm...@lapize.com>.
Hi,

We are using validator, version 20010702, we cannot use a newer version
cause ServletExect3.1, the server we use, has a bug that prevents it from
using commons-logging, and newer versions of the validator rely on this.
Struts version is 1.02.

We think we have everything set  up ok, but cannot make the validation work,
is there an example somewhere that we could use as template (preferabily
with an old version of the validator like the one we are using)

thanks,



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


RE: Dont get it: Logging

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Mon, 15 Jul 2002, Jacob Hookom wrote:

> Date: Mon, 15 Jul 2002 12:41:37 -0500
> From: Jacob Hookom <ho...@uwec.edu>
> Reply-To: Struts Users Mailing List <st...@jakarta.apache.org>
> To: 'Struts Users Mailing List' <st...@jakarta.apache.org>
> Subject: RE: Dont get it: Logging
>
> Does the commons logging fall under the same configuration options as
> log4j? If so, where would I place this properties file? (I'm assuming
> web-inf/classes)
>

The "commons-logging.properties" has to be visible to the web app class
loader.  The easiest way is to put it in "WEB-INF/classes".

Craig


> Regards
> Jacob Hookom
> CS Student
> University of Wisconsin, Eau Claire
> ===================================
> http://www.swanked.net
> you're not hip enough yet
>
> -----Original Message-----
> From: Craig R. McClanahan [mailto:craigmcc@apache.org]
> Sent: Monday, July 15, 2002 12:38 PM
> To: Struts Users Mailing List
> Subject: Re: Dont get it: Logging
>
>
>
> On Mon, 15 Jul 2002, rainer juenger wrote:
>
> > Date: Mon, 15 Jul 2002 19:36:04 +0200
> > From: rainer juenger <ja...@projektinter.net>
> > Reply-To: Struts Users Mailing List <st...@jakarta.apache.org>
> > To: Struts Users Mailing List <st...@jakarta.apache.org>
> > Subject: Dont get it: Logging
> >
> > Hi,
> >
> > need a hint.
> > Struts is using the commons Logging.
> >
> > private Log log =
> >         LogFactory.getLog("org.apache.struts.webapp.Example");
> >
> > 1)
> > Where actually can I find the log file??
> > It should be where it is configured in the package
> org.apache.commons.logging
> > configured in commons-logging.properties
> > But there is no propertie-file.
> >
>
> See the commons-logging javadocs for more info:
>
>   http://jakarta.apache.org/commons/logging/api/
>
> Basically, commons-logging defaults are based on:
> * If Log4J is visible, use it
> * If running on JDK 1.4, use it
> * Default to a "no-op" log that swallows all messages.
>
> > 2)
> >             if (log.isDebugEnabled()) {
> >                 log.debug(" User is not logged on in session "
> >                           + session.getId());
> >             }
> >
> > Why is that? log.debug("something") would do? Is it for speeding up??
> >
>
> Yes.  If you just did:
>
>   log.debug(" User is not logged on in session " + session.getId());
>
> without the if statement, the String concatenation would be performed
> even
> though the message was going to get thrown away.  With lots of
> log.debug()
> calls, this can really add up.
>
> > thanks, Rainer
> >
>
> Craig
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.375 / Virus Database: 210 - Release Date: 7/10/2002
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.375 / Virus Database: 210 - Release Date: 7/10/2002
>
>
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>


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


RE: Dont get it: Logging

Posted by Jacob Hookom <ho...@uwec.edu>.
Does the commons logging fall under the same configuration options as
log4j? If so, where would I place this properties file? (I'm assuming
web-inf/classes)

Regards
Jacob Hookom
CS Student
University of Wisconsin, Eau Claire
===================================
http://www.swanked.net
you're not hip enough yet

-----Original Message-----
From: Craig R. McClanahan [mailto:craigmcc@apache.org] 
Sent: Monday, July 15, 2002 12:38 PM
To: Struts Users Mailing List
Subject: Re: Dont get it: Logging



On Mon, 15 Jul 2002, rainer juenger wrote:

> Date: Mon, 15 Jul 2002 19:36:04 +0200
> From: rainer juenger <ja...@projektinter.net>
> Reply-To: Struts Users Mailing List <st...@jakarta.apache.org>
> To: Struts Users Mailing List <st...@jakarta.apache.org>
> Subject: Dont get it: Logging
>
> Hi,
>
> need a hint.
> Struts is using the commons Logging.
>
> private Log log =
>         LogFactory.getLog("org.apache.struts.webapp.Example");
>
> 1)
> Where actually can I find the log file??
> It should be where it is configured in the package
org.apache.commons.logging
> configured in commons-logging.properties
> But there is no propertie-file.
>

See the commons-logging javadocs for more info:

  http://jakarta.apache.org/commons/logging/api/

Basically, commons-logging defaults are based on:
* If Log4J is visible, use it
* If running on JDK 1.4, use it
* Default to a "no-op" log that swallows all messages.

> 2)
>             if (log.isDebugEnabled()) {
>                 log.debug(" User is not logged on in session "
>                           + session.getId());
>             }
>
> Why is that? log.debug("something") would do? Is it for speeding up??
>

Yes.  If you just did:

  log.debug(" User is not logged on in session " + session.getId());

without the if statement, the String concatenation would be performed
even
though the message was going to get thrown away.  With lots of
log.debug()
calls, this can really add up.

> thanks, Rainer
>

Craig


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

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.375 / Virus Database: 210 - Release Date: 7/10/2002
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.375 / Virus Database: 210 - Release Date: 7/10/2002
 


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


Re: Dont get it: Logging

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Mon, 15 Jul 2002, rainer juenger wrote:

> Date: Mon, 15 Jul 2002 19:36:04 +0200
> From: rainer juenger <ja...@projektinter.net>
> Reply-To: Struts Users Mailing List <st...@jakarta.apache.org>
> To: Struts Users Mailing List <st...@jakarta.apache.org>
> Subject: Dont get it: Logging
>
> Hi,
>
> need a hint.
> Struts is using the commons Logging.
>
> private Log log =
>         LogFactory.getLog("org.apache.struts.webapp.Example");
>
> 1)
> Where actually can I find the log file??
> It should be where it is configured in the package org.apache.commons.logging
> configured in commons-logging.properties
> But there is no propertie-file.
>

See the commons-logging javadocs for more info:

  http://jakarta.apache.org/commons/logging/api/

Basically, commons-logging defaults are based on:
* If Log4J is visible, use it
* If running on JDK 1.4, use it
* Default to a "no-op" log that swallows all messages.

> 2)
>             if (log.isDebugEnabled()) {
>                 log.debug(" User is not logged on in session "
>                           + session.getId());
>             }
>
> Why is that? log.debug("something") would do? Is it for speeding up??
>

Yes.  If you just did:

  log.debug(" User is not logged on in session " + session.getId());

without the if statement, the String concatenation would be performed even
though the message was going to get thrown away.  With lots of log.debug()
calls, this can really add up.

> thanks, Rainer
>

Craig


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