You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by shankarr <sh...@adventnet.com> on 2004/01/27 16:14:21 UTC

log4j integration

Hi!
I have integrated log4j with struts.
I need to know how to ensure that the changes done to log4j.properties file 
is taken into account at run time.
TIA,
Richie

"To achieve all that is possible, one must attempt the impossible"



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


Re: log4j integration

Posted by Geeta Ramani <ge...@cmpco.com>.
Ritchie:

Just make sure the log4j.properties is in your class path.. (like maybe right
in your classes directory).  that should do it..

Regards,
Geeta

shankarr wrote:

> Hi!
> I have integrated log4j with struts.
> I need to know how to ensure that the changes done to log4j.properties file

> is taken into account at run time.
> TIA,
> Richie
>
> "To achieve all that is possible, one must attempt the impossible"
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org


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


Re: log4j integration

Posted by Geeta Ramani <ge...@cmpco.com>.
*Yes*!!  The LogManager is the ticket - I didn't know about this class, so tried it
out.  Works like a charm.. :) Thanks, Shirish (I think?  I inadvertently erased the
response to this question so am not sure of its author..)

Geeta


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


Re: log4j integration

Posted by shankarr <sh...@adventnet.com>.
Hi!

Yes, I figured that out.
But, that leaves the question open as to how do you make struts as a whole 
understand that changes have been
made to the log4j.properties file.
In fact, the question boils down to this:
Where do I get the handle to the log4j.properties file(let us say, using 
the File class)?
And once I do, will it be sufficient that I set the PropertyConfigurator 
method with the requisite parameters?
Actually, the whole point of the exercise is to use the dynamic reloading 
of changes made to the log4j.properties file facility provided by log4j.

Richie

At 07:01 AM 1/28/2004 -0500, you wrote:
>Please forgive this note if it seems too obvious and I have misunderstood your
>question/comments..
>
>If you think of both struts and log4j as just a bunch of Java 
>packages/classes,
>then you will see that "integrating struts with log4j" is really nothing
>unusual.  The log4j jar (or classes in the jar) needs a log4j.properties file
>(the name of this file is most probably hard-coded in the classes in log4j 
>jar,
>which is why you don't need to personally tie the file with log4j) and 
>this file
>should therefore be in the classpath and as you have found out yourself, 
>this is
>all that is required...If for some reason you need a handle to this file, I
>don't see why the usual File class in the java.io package won't do the 
>trick..?
>
>As for how to ensure that changes in your log4j.properties is made visible to
>struts, well, I guess you'll have to restart tomcat (or your app 
>server)..(:( I
>don't believe the admin/reload.do will work (that works for changes to the
>struts-config.xml and such a blessing *that* is during development!!) ..
>
>Hope this helps,
>Geeta
>
>shankarr wrote:
>
> > Hi!
> >
> > In fact, I got two responses for the question as I had sent the same
> > question twice.
> > My mailbox was acting funny yesterday, so I had to send it twice.
> >
> > Well, I do have the log4j.properties file under <web-inf>/classes
> > I had thought of using the PropertyConfigurator too.
> > But, when you integrate log4j with struts, we no where mention the
> > log4j.properties file specifically, ie, we
> > just create the file and put it under the mentioned location.
> > And when we use it, we do not mention the log4j.properties file anywhere in
> > the files too.
> > So, how to get a handle to the file?
> > Correct me if there are better approaches to the same.
> >
> > Steps by which I integrated are :
> >
> > a)Got the log4j.jar file
> > b)created the log4j.properties file
> > c)created commons-logging.properties file
> > d) used static logger = new logger(this) in the files where this is the
> > class name.
> >
> > TIA,
> >
> > Richie
> >
> > At 02:28 PM 1/27/2004 -0600, you wrote:
> > >Do you mean changes made after the initial configuration of 
> log4j?  You can
> > >use
> > >
> > >         PropertyConfigurator.configureAndWatch( cfgFile, delay )
> > >
> > >This will load your log4j configuration file and create a thread that 
> looks
> > >for changes to the config file reloading when necessary.
> > >
> > >--Norm
> > >
> > >--
> > >Norm Deane
> > >MIS Consultant
> > >Vanderbilt University
> > >(615) 322-7855
> > >norm.deane@vanderbilt.edu
> > >
> > > > -----Original Message-----
> > > > From: shankarr [mailto:shankarr@adventnet.com]
> > > > Sent: Tuesday, January 27, 2004 9:14 AM
> > > > To: struts-user@jakarta.apache.org
> > > > Subject: log4j integration
> > > >
> > > >
> > > > Hi!
> > > > I have integrated log4j with struts.
> > > > I need to know how to ensure that the changes done to
> > > > log4j.properties file
> > > > is taken into account at run time.
> > > > TIA,
> > > > Richie
> > > >
> > > > "To achieve all that is possible, one must attempt the impossible"
> > > >
> > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > > > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> > > >
> > > >
> > >
> > >
> > >---------------------------------------------------------------------
> > >To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > >For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
> > "To achieve all that is possible, one must attempt the impossible"
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org

"To achieve all that is possible, one must attempt the impossible"



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


RE: log4j integration

Posted by Norm Deane <no...@vanderbilt.edu>.
We use an alternative approach that allows for a more dynamic log4j
configuration approach.  In our webapps we have a Servlet that loads on
startup that is responsible for configuring log4j and updating the log4j
configuration when the configuration file changes.  


<web.xml-sinppets>

   <servlet>
      <servlet-name>Log4JConfigurator</servlet-name>
 
<servlet-class>edu.vanderbilt.mis.log4j.ConfigureLog4jServlet</servlet-class
>
      <init-param>
         <param-name>reloadDelay</param-name>
         <param-value>300000</param-value>
         </init-param>
      <init-param>
        <param-name>propertyFile</param-name>
       <param-value>/log4j/fis/config/edog.log4j.properties</param-value>
      </init-param>
      <load-on-startup>1</load-on-startup>
   </servlet>

   <servlet-mapping>
      <servlet-name>Log4JConfigurator</servlet-name>
      <url-pattern>/config</url-pattern>
   </servlet-mapping>

</web.xml-sinppets>



<servlet-code>

package edu.vanderbilt.mis.log4j;

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;

import org.apache.log4j.*;
import org.apache.log4j.spi.*;
import org.apache.log4j.helpers.*;
import java.net.URL;

/**
 * Handles the initialization of Log4j.  On startup, this method with deifne
 * the reload frequency of the property file and where the property file is
 * located.
 * <p>
 * This servlet expects two properties to be defined as configuration
 * properties.  They are as follows...
 * <ul>
 * <li>reloadDelay - the number of miliseconds to wait before reloading the
property file.</li>
 * <li>propertyFile - the property file to be reloaded.</li>
 * </ul>
 * @author unascribed
 * @version 1.0
 */
public class ConfigureLog4jServlet  extends HttpServlet
{
   public static final String RELOAD_DELAY_PROPERTY_NAME = "reloadDelay";
   public static final String PROPERTY_FILE_PROPERTY_NAME = "propertyFile";

   /**
    * Handles the initialization of Log4j.  On startup, this method with
deifne
    * the reload frequency of the property file and where the property file
is
    * located.
    */
   public void init( ServletConfig config ) throws ServletException
   {
      super.init( config );
      long delay = getReloadDelay();
      LogLog.debug( "Reload Delay is [" + delay + "]" );

      String cfgFile = getPropertyFileLocation();
      LogLog.debug( "Log4j configuration file is [" + cfgFile + "]" );

      if ( cfgFile == null )
         throw new ServletException( "Log4j configuration file was not
specified." );

      PropertyConfigurator.configureAndWatch( cfgFile, delay );
   }


   /**
    * Diaplays the reload delay and the location of the configuration file.
    */
	public void doGet(HttpServletRequest request, HttpServletResponse
response) throws ServletException, IOException
	{
      response.addHeader( "Cache-Control", "no-cache" );
      response.addHeader( "Pragma", "no-cache" );
      response.addHeader( "Expires", "-1" );
      response.setContentType( "text/html" );

      PrintWriter out = response.getWriter();

      out.println( "<HTML><BODY>" );
      out.println( "<B>Log4J Configurator</B><BR><BR>" );
      out.println( "Reload Delay is [" + getReloadDelay() + "]
milliseconds<br>" );
      out.println( "Configuration File is [" + getPropertyFileLocation() +
"]" );

      File logConfigFile = new File( getPropertyFileLocation() );
      if ( !logConfigFile.exists() )
      {
         out.println( "<p>Configuration file does not exist</p>" );
      }
      else
      {
         out.println( "<p>Configuration file contents</p>" );
         out.println( "<pre>" );

         FileReader fReader = new FileReader( logConfigFile );
         BufferedReader bReader = new BufferedReader( fReader );


         String line = null;
         while (  (line = bReader.readLine() ) != null)
         {
            out.println( line );
         }
      }
      out.println( "</pre>" );
      out.println( "</BODY></HTML>" );
      out.close();
    }


   /**
    * Returns the reload delay for the Log4J configuration file.  This
method
    * first checks for the reload delay property in the web.xml.  If it is
not
    * set in the web.xml the default is used as defined in the FileWatchDog.
    */
   public long getReloadDelay()
   {
      String s = getServletConfig().getInitParameter(
RELOAD_DELAY_PROPERTY_NAME );
      try
      {
         return new Long( s ).longValue();
      }
      catch ( NumberFormatException nfe )
      {
         return FileWatchdog.DEFAULT_DELAY;
      }
   }

   /**
    * Returns the location of the log4j property file.  The property file
location
    * should be an init parameter for this servlet.
    */
   public String getPropertyFileLocation()
   {
      return getServletConfig().getInitParameter(
PROPERTY_FILE_PROPERTY_NAME );
   }
}

</servlet-code>

-- 
Norm Deane
MIS Consultant
Vanderbilt University
(615) 322-7855
norm.deane@vanderbilt.edu 

> -----Original Message-----
> From: Geeta Ramani [mailto:geeta.ramani@cmpco.com] 
> Sent: Wednesday, January 28, 2004 6:01 AM
> To: Struts Users Mailing List
> Subject: Re: log4j integration
> 
> 
> Please forgive this note if it seems too obvious and I have 
> misunderstood your question/comments..
> 
> If you think of both struts and log4j as just a bunch of Java 
> packages/classes, then you will see that "integrating struts 
> with log4j" is really nothing unusual.  The log4j jar (or 
> classes in the jar) needs a log4j.properties file (the name 
> of this file is most probably hard-coded in the classes in 
> log4j jar, which is why you don't need to personally tie the 
> file with log4j) and this file should therefore be in the 
> classpath and as you have found out yourself, this is all 
> that is required...If for some reason you need a handle to 
> this file, I don't see why the usual File class in the 
> java.io package won't do the trick..?
> 
> As for how to ensure that changes in your log4j.properties is 
> made visible to struts, well, I guess you'll have to restart 
> tomcat (or your app server)..(:( I don't believe the 
> admin/reload.do will work (that works for changes to the 
> struts-config.xml and such a blessing *that* is during 
> development!!) ..
> 
> Hope this helps,
> Geeta
> 
> shankarr wrote:
> 
> > Hi!
> >
> > In fact, I got two responses for the question as I had sent 
> the same 
> > question twice. My mailbox was acting funny yesterday, so I had to 
> > send it twice.
> >
> > Well, I do have the log4j.properties file under <web-inf>/classes I 
> > had thought of using the PropertyConfigurator too. But, when you 
> > integrate log4j with struts, we no where mention the 
> log4j.properties 
> > file specifically, ie, we just create the file and put it under the 
> > mentioned location. And when we use it, we do not mention the 
> > log4j.properties file anywhere in the files too.
> > So, how to get a handle to the file?
> > Correct me if there are better approaches to the same.
> >
> > Steps by which I integrated are :
> >
> > a)Got the log4j.jar file
> > b)created the log4j.properties file
> > c)created commons-logging.properties file
> > d) used static logger = new logger(this) in the files where this is 
> > the class name.
> >
> > TIA,
> >
> > Richie
> >
> > At 02:28 PM 1/27/2004 -0600, you wrote:
> > >Do you mean changes made after the initial configuration 
> of log4j?  
> > >You can use
> > >
> > >         PropertyConfigurator.configureAndWatch( cfgFile, delay )
> > >
> > >This will load your log4j configuration file and create a 
> thread that 
> > >looks for changes to the config file reloading when necessary.
> > >
> > >--Norm
> > >
> > >--
> > >Norm Deane
> > >MIS Consultant
> > >Vanderbilt University
> > >(615) 322-7855
> > >norm.deane@vanderbilt.edu
> > >
> > > > -----Original Message-----
> > > > From: shankarr [mailto:shankarr@adventnet.com]
> > > > Sent: Tuesday, January 27, 2004 9:14 AM
> > > > To: struts-user@jakarta.apache.org
> > > > Subject: log4j integration
> > > >
> > > >
> > > > Hi!
> > > > I have integrated log4j with struts.
> > > > I need to know how to ensure that the changes done to 
> > > > log4j.properties file is taken into account at run time.
> > > > TIA,
> > > > Richie
> > > >
> > > > "To achieve all that is possible, one must attempt the 
> impossible"
> > > >
> > > >
> > > >
> > > > 
> ------------------------------------------------------------------
> > > > ---
> > > > To unsubscribe, e-mail: 
> struts-user-unsubscribe@jakarta.apache.org
> > > > For additional commands, e-mail: 
> struts-user-help@jakarta.apache.org
> > > >
> > > >
> > >
> > >
> > 
> >---------------------------------------------------------------------
> > >To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > >For additional commands, e-mail: 
> struts-user-help@jakarta.apache.org
> >
> > "To achieve all that is possible, one must attempt the impossible"
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 


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


Re: log4j integration

Posted by Geeta Ramani <ge...@cmpco.com>.
Please forgive this note if it seems too obvious and I have misunderstood your
question/comments..

If you think of both struts and log4j as just a bunch of Java packages/classes,
then you will see that "integrating struts with log4j" is really nothing
unusual.  The log4j jar (or classes in the jar) needs a log4j.properties file
(the name of this file is most probably hard-coded in the classes in log4j jar,
which is why you don't need to personally tie the file with log4j) and this file
should therefore be in the classpath and as you have found out yourself, this is
all that is required...If for some reason you need a handle to this file, I
don't see why the usual File class in the java.io package won't do the trick..?

As for how to ensure that changes in your log4j.properties is made visible to
struts, well, I guess you'll have to restart tomcat (or your app server)..(:( I
don't believe the admin/reload.do will work (that works for changes to the
struts-config.xml and such a blessing *that* is during development!!) ..

Hope this helps,
Geeta

shankarr wrote:

> Hi!
>
> In fact, I got two responses for the question as I had sent the same
> question twice.
> My mailbox was acting funny yesterday, so I had to send it twice.
>
> Well, I do have the log4j.properties file under <web-inf>/classes
> I had thought of using the PropertyConfigurator too.
> But, when you integrate log4j with struts, we no where mention the
> log4j.properties file specifically, ie, we
> just create the file and put it under the mentioned location.
> And when we use it, we do not mention the log4j.properties file anywhere in
> the files too.
> So, how to get a handle to the file?
> Correct me if there are better approaches to the same.
>
> Steps by which I integrated are :
>
> a)Got the log4j.jar file
> b)created the log4j.properties file
> c)created commons-logging.properties file
> d) used static logger = new logger(this) in the files where this is the
> class name.
>
> TIA,
>
> Richie
>
> At 02:28 PM 1/27/2004 -0600, you wrote:
> >Do you mean changes made after the initial configuration of log4j?  You can
> >use
> >
> >         PropertyConfigurator.configureAndWatch( cfgFile, delay )
> >
> >This will load your log4j configuration file and create a thread that looks
> >for changes to the config file reloading when necessary.
> >
> >--Norm
> >
> >--
> >Norm Deane
> >MIS Consultant
> >Vanderbilt University
> >(615) 322-7855
> >norm.deane@vanderbilt.edu
> >
> > > -----Original Message-----
> > > From: shankarr [mailto:shankarr@adventnet.com]
> > > Sent: Tuesday, January 27, 2004 9:14 AM
> > > To: struts-user@jakarta.apache.org
> > > Subject: log4j integration
> > >
> > >
> > > Hi!
> > > I have integrated log4j with struts.
> > > I need to know how to ensure that the changes done to
> > > log4j.properties file
> > > is taken into account at run time.
> > > TIA,
> > > Richie
> > >
> > > "To achieve all that is possible, one must attempt the impossible"
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> > >
> > >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
> "To achieve all that is possible, one must attempt the impossible"


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


RE: Regarding :

Posted by Ramachandran <ra...@summitworks.com>.
Hi Nicolas,

                It was working fine by using <bean:define> to get the value
from the iterator...... Very Very thankful to u.....

Bye
Ram


-----Original Message-----
From: Nicolas De Loof [mailto:nicolas.deloof@cgey.com]
Sent: Wednesday, January 28, 2004 4:45 PM
To: Struts Users Mailing List
Subject: Re: Regarding : <logic:iterate>


Use this :

<logic:iterate id="maxreqiddetail" name="maxreqiddetails">
    <bean:define id="s" name="maxreqiddetail" property="primary_skill"/>
...
</logic:iterate>

They're is a JSTL way to do this too, but I don't use it so cannot tell you
how.
Nico.

>
>
> ----- Original Message -----
> From: "Ramachandran" <ra...@summitworks.com>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Wednesday, January 28, 2004 1:43 PM
> Subject: Regarding : <logic:iterate>
>
>
> >
> > Hi All,
> >            Can any one please tell me, how to assign a values to a
string
> > using <logic:iterate>
> >
> > Example:    <logic:iterate id="maxreqiddetail" name="maxreqiddetails">
> >
> >             </logic:iterate>
> >
> >            In this iterator, i am having values in the name
> > 'maxreqiddetails" as primary_skill and location.
> >
> >            I know how to print the values...by using< bean:write
> > name="maxrediddetail" property="primary_skill"/>
> >
> > But i wanto assing those values to a String. How can i do that one.
> >
> > Please anu body having any idea plase reply me
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org

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



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


question about tiles

Posted by Marco Mistroni <mm...@waersystems.com>.
Hi all,
	I was wondering one thing..
Suppose that in page1 I define a <tiles:setAttribute name="foo">

Is It possible to get it out from page2 WITHIN a custom JSP tag?

Thanx in advance and regards
	marco


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


Re: Regarding :

Posted by Nicolas De Loof <ni...@cgey.com>.
Use this :

<logic:iterate id="maxreqiddetail" name="maxreqiddetails">
    <bean:define id="s" name="maxreqiddetail" property="primary_skill"/>
...
</logic:iterate>

They're is a JSTL way to do this too, but I don't use it so cannot tell you how.
Nico.

> 
> 
> ----- Original Message ----- 
> From: "Ramachandran" <ra...@summitworks.com>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Wednesday, January 28, 2004 1:43 PM
> Subject: Regarding : <logic:iterate>
> 
> 
> > 
> > Hi All,
> >            Can any one please tell me, how to assign a values to a string
> > using <logic:iterate>
> > 
> > Example:    <logic:iterate id="maxreqiddetail" name="maxreqiddetails">
> > 
> >             </logic:iterate>
> > 
> >            In this iterator, i am having values in the name
> > 'maxreqiddetails" as primary_skill and location.
> > 
> >            I know how to print the values...by using< bean:write
> > name="maxrediddetail" property="primary_skill"/>
> > 
> > But i wanto assing those values to a String. How can i do that one.
> > 
> > Please anu body having any idea plase reply me
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org

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


Re: Regarding :

Posted by Raman Garg <ra...@smartdatainc.com>.
Hello,
I hope following will resolve your problem:

 <logic:iterate id="maxreqiddetail" name="maxreqiddetails">
<%
   String s=maxreqiddetail.getPrimary_skill();
%>
 </logic:iterate>

I haven't tested it but i think it will work.

Thanks,
-- Raman


----- Original Message ----- 
From: "Ramachandran" <ra...@summitworks.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Wednesday, January 28, 2004 1:43 PM
Subject: Regarding : <logic:iterate>


> 
> Hi All,
>            Can any one please tell me, how to assign a values to a string
> using <logic:iterate>
> 
> Example:    <logic:iterate id="maxreqiddetail" name="maxreqiddetails">
> 
>             </logic:iterate>
> 
>            In this iterator, i am having values in the name
> 'maxreqiddetails" as primary_skill and location.
> 
>            I know how to print the values...by using< bean:write
> name="maxrediddetail" property="primary_skill"/>
> 
> But i wanto assing those values to a String. How can i do that one.
> 
> Please anu body having any idea plase reply me
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 

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


Regarding :

Posted by Ramachandran <ra...@summitworks.com>.
Hi All,
           Can any one please tell me, how to assign a values to a string
using <logic:iterate>

Example:    <logic:iterate id="maxreqiddetail" name="maxreqiddetails">

            </logic:iterate>

           In this iterator, i am having values in the name
'maxreqiddetails" as primary_skill and location.

           I know how to print the values...by using< bean:write
name="maxrediddetail" property="primary_skill"/>

But i wanto assing those values to a String. How can i do that one.

Please anu body having any idea plase reply me


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


RE: log4j integration

Posted by shankarr <sh...@adventnet.com>.
Hi!

In fact, I got two responses for the question as I had sent the same 
question twice.
My mailbox was acting funny yesterday, so I had to send it twice.

Well, I do have the log4j.properties file under <web-inf>/classes
I had thought of using the PropertyConfigurator too.
But, when you integrate log4j with struts, we no where mention the 
log4j.properties file specifically, ie, we
just create the file and put it under the mentioned location.
And when we use it, we do not mention the log4j.properties file anywhere in 
the files too.
So, how to get a handle to the file?
Correct me if there are better approaches to the same.

Steps by which I integrated are :

a)Got the log4j.jar file
b)created the log4j.properties file
c)created commons-logging.properties file
d) used static logger = new logger(this) in the files where this is the 
class name.

TIA,

Richie



At 02:28 PM 1/27/2004 -0600, you wrote:
>Do you mean changes made after the initial configuration of log4j?  You can
>use
>
>         PropertyConfigurator.configureAndWatch( cfgFile, delay )
>
>This will load your log4j configuration file and create a thread that looks
>for changes to the config file reloading when necessary.
>
>--Norm
>
>--
>Norm Deane
>MIS Consultant
>Vanderbilt University
>(615) 322-7855
>norm.deane@vanderbilt.edu
>
> > -----Original Message-----
> > From: shankarr [mailto:shankarr@adventnet.com]
> > Sent: Tuesday, January 27, 2004 9:14 AM
> > To: struts-user@jakarta.apache.org
> > Subject: log4j integration
> >
> >
> > Hi!
> > I have integrated log4j with struts.
> > I need to know how to ensure that the changes done to
> > log4j.properties file
> > is taken into account at run time.
> > TIA,
> > Richie
> >
> > "To achieve all that is possible, one must attempt the impossible"
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
> >
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org

"To achieve all that is possible, one must attempt the impossible"


[OT] Re: log4j integration

Posted by Guido GarcĂ­a Bernardo <gg...@itdeusto.com>.
This is OT. The word "struts" in a message is not the only thing it 
needs to be struts related...

Try PropertyConfigurator.configureAndWatch, I think that is what you are 
searching for...
You cand find a simple example at 
http://www.jguru.com/forums/view.jsp?EID=1130416

Un saludo, chicos.
Guido.

shankarr wrote:

> Hi!
> I have integrated log4j with struts.
> I need to know how to ensure that the changes done to log4j.properties 
> file is taken into account at run time.
> TIA,
> Richie
>
> "To achieve all that is possible, one must attempt the impossible"


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


RE: log4j integration

Posted by Norm Deane <no...@vanderbilt.edu>.
Do you mean changes made after the initial configuration of log4j?  You can
use 

	PropertyConfigurator.configureAndWatch( cfgFile, delay )

This will load your log4j configuration file and create a thread that looks
for changes to the config file reloading when necessary.

--Norm

-- 
Norm Deane
MIS Consultant
Vanderbilt University
(615) 322-7855
norm.deane@vanderbilt.edu 

> -----Original Message-----
> From: shankarr [mailto:shankarr@adventnet.com] 
> Sent: Tuesday, January 27, 2004 9:14 AM
> To: struts-user@jakarta.apache.org
> Subject: log4j integration
> 
> 
> Hi!
> I have integrated log4j with struts.
> I need to know how to ensure that the changes done to 
> log4j.properties file 
> is taken into account at run time.
> TIA,
> Richie
> 
> "To achieve all that is possible, one must attempt the impossible"
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 


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