You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Raghuveer <ra...@infotechsw.com> on 2006/07/10 16:32:26 UTC

Struts and commons logging

We use struts applications and loggging by log 4j.

We are configuring loggers like normal MVS application.

But,
What is that i need to do if i want my struts application to use
commons-logging for logging.






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


RE: Struts and commons logging

Posted by Jacob Kjome <ho...@visi.com>.
log4j.xml, of course.  Struts, itself, has nothing to do with logging.  That is
left to commons-logging, which it utilizes.  And since commons-logging, in
turn, utilizes logging implementations (using runtime discovery), your logging
configuration would be for the logging implementation that you use.

The only possible extra config is a commons-logging.properties file that might
explicitly state the logging configuration you wish to use.  However, since
commons-logging uses Log4j in preference to other implementations (if it is
found, using discovery, at runtime), you usually don't need to provide such a
config file.

So, just configure Log4j and you should be golden.

Jake

Quoting Raghuveer <ra...@infotechsw.com>:

> Where shall we nned to add below code.is it in struts-config or log.xml
>
> -----Original Message-----
> From: Jacob Kjome [mailto:hoju@visi.com]
> Sent: Monday, July 10, 2006 10:24 PM
> To: Log4J Users List; raghuveerv@infotechsw.com
> Subject: Re: Struts and commons logging
>
>
> Quoting Raghuveer <ra...@infotechsw.com>:
>
> > We use struts applications and loggging by log 4j.
> >
> > We are configuring loggers like normal MVS application.
> >
> > But,
> > What is that i need to do if i want my struts application to use
> > commons-logging for logging.
> >
>
> I'm not quite sure I understand the question?  commons-logging is a wrapper
> for
> logging implementations.  If you are currently using Log4j for application
> logging, then it is probably the implementation of choice for struts
> logging.
> Simply define a logger for struts...
>
> <logger name="org.apache.struts">
>     <level value="INFO"/>
> </logger>
>
> presumably, you've already defined an appender in the primordial <root>
> logger,
> so no need to define another here unless you care to.
>
> Jake
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>




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


RE: Struts and commons logging

Posted by Raghuveer <ra...@infotechsw.com>.
Where shall we nned to add below code.is it in struts-config or log.xml

-----Original Message-----
From: Jacob Kjome [mailto:hoju@visi.com]
Sent: Monday, July 10, 2006 10:24 PM
To: Log4J Users List; raghuveerv@infotechsw.com
Subject: Re: Struts and commons logging


Quoting Raghuveer <ra...@infotechsw.com>:

> We use struts applications and loggging by log 4j.
>
> We are configuring loggers like normal MVS application.
>
> But,
> What is that i need to do if i want my struts application to use
> commons-logging for logging.
>

I'm not quite sure I understand the question?  commons-logging is a wrapper
for
logging implementations.  If you are currently using Log4j for application
logging, then it is probably the implementation of choice for struts
logging.
Simply define a logger for struts...

<logger name="org.apache.struts">
    <level value="INFO"/>
</logger>

presumably, you've already defined an appender in the primordial <root>
logger,
so no need to define another here unless you care to.

Jake


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


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


Re: Struts and commons logging

Posted by Jacob Kjome <ho...@visi.com>.
Quoting Raghuveer <ra...@infotechsw.com>:

> We use struts applications and loggging by log 4j.
>
> We are configuring loggers like normal MVS application.
>
> But,
> What is that i need to do if i want my struts application to use
> commons-logging for logging.
>

I'm not quite sure I understand the question?  commons-logging is a wrapper for
logging implementations.  If you are currently using Log4j for application
logging, then it is probably the implementation of choice for struts logging. 
Simply define a logger for struts...

<logger name="org.apache.struts">
    <level value="INFO"/>
</logger>

presumably, you've already defined an appender in the primordial <root> logger,
so no need to define another here unless you care to.

Jake


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


Re: Struts and commons logging

Posted by Adam Gordon <ad...@readytalk.com>.
I believe, though I could be wrong, that you get logging for free, you 
just have to configure it.  Check out the struts logging section of the 
struts wiki at http://wiki.apache.org/struts/StrutsLogging, you also may 
want to bookmark the URL http://wiki.apache.org/struts for future 
reference as it contains all kinds of helpful information.

-adam

Raghuveer wrote:
> We use struts applications and loggging by log 4j.
>
> We are configuring loggers like normal MVS application.
>
> But,
> What is that i need to do if i want my struts application to use
> commons-logging for logging.
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>   

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


Re: Struts and commons logging

Posted by Adam Gordon <ad...@readytalk.com>.
I believe, though I could be wrong, that you get logging for free, you 
just have to configure it.  Check out the struts logging section of the 
struts wiki at http://wiki.apache.org/struts/StrutsLogging, you also may 
want to bookmark the URL http://wiki.apache.org/struts for future 
reference as it contains all kinds of helpful information.

-adam

Raghuveer wrote:
> We use struts applications and loggging by log 4j.
>
> We are configuring loggers like normal MVS application.
>
> But,
> What is that i need to do if i want my struts application to use
> commons-logging for logging.
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>   

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