Struts 1 Logging
Hello , We are using Struts 1 , Can someone tell me how can I enable Struts logs in debug mode, Basically I am looking for statements as below - BeanUtils 1 org.apache.commons.beanutils.BeanUtils populate BeanUtils.populate( Thanks and regards
Re: Struts 1 Logging
Hello Paul. We are using java.util.logging.Logger in our application. Regards Usha On Fri, May 30, 2014 at 9:02 AM, Paul Benedict wrote: > Usha, what logging framework are you using? > > > Cheers, > Paul > > > On Thu, May 29, 2014 at 10:28 PM, Usha Ladkani > wrote: > > > Hello , > > > > We are using Struts 1 , Can someone tell me how can I enable Struts logs > in > > debug mode, Basically I am looking for statements as below - > > > > BeanUtils 1 org.apache.commons.beanutils.BeanUtils populate > > BeanUtils.populate( > > > > Thanks and regards > > >
Re: Struts 1 Logging
Hello Paul. Now I have configured log4j-1.2.13.jar. Below is my log4j.properties file content. log4j.rootLogger=DEBUG, R log4j.appender.R=org.apache.log4j.RollingFileAppender log4j.appender.R.File=usha.log log4j.appender.R.MaxFileSize=10MB log4j.appender.R.MaxBackupIndex=10 log4j.appender.R.layout=org.apache.log4j.PatternLayout log4j.appender.R.layout.ConversionPattern=[%d{MM/dd/yy HH:mm:ss}] source=%c thread=[%t] %m%n I get log file names usha.log created m But it doesnt has any struts related logging after I perform the action. Just the below content is logged. [05/30/14 09:14:21] source=com.ibm.bcg.consoleUI.action.partners.PartnerCreateAction thread=[WebContainer : 3] Logging initialized. [05/30/14 09:14:21] source=com.ibm.bcg.consoleUI.action.partners.PartnerCreateAction thread=[WebContainer : 3] Log4jProperties: C:\Program Files\ibm\bcghub-distrib\wasND\Profiles\bcgprofile\installedApps\wpgCell\BCGConsole.ear\console.war\WEB-INF\lib\log4j.properties Which are logged by my action class. Could you please help if I am missing something. Thanks Usha On Fri, May 30, 2014 at 9:16 AM, Paul Benedict wrote: > Okay, but Struts 1 uses Apache Commons Logging. That means you'll need to > configure that or use Apache Log4j 1.x configuration which is also > supported. > > > Cheers, > Paul > > > On Thu, May 29, 2014 at 10:38 PM, Usha Ladkani > wrote: > > > Hello Paul. > > > > We are using java.util.logging.Logger in our application. > > > > Regards > > Usha > > > > > > On Fri, May 30, 2014 at 9:02 AM, Paul Benedict > > wrote: > > > > > Usha, what logging framework are you using? > > > > > > > > > Cheers, > > > Paul > > > > > > > > > On Thu, May 29, 2014 at 10:28 PM, Usha Ladkani > > > wrote: > > > > > > > Hello , > > > > > > > > We are using Struts 1 , Can someone tell me how can I enable Struts > > logs > > > in > > > > debug mode, Basically I am looking for statements as below - > > > > > > > > BeanUtils 1 org.apache.commons.beanutils.BeanUtils populate > > > > BeanUtils.populate( > > > > > > > > Thanks and regards > > > > > > > > > >
Re: Struts 1 Logging
Now empty log file is being created. I see this error in systemout which i printed too [30/5/14 12:23:48:824 UTC] 0086 R UOW= source=SystemErr org=IBM prod=WebSphere component=Application Server thread=[WebContainer : 0] log4j:WARN No appenders could be found for logger (com.ibm.bcg.consoleUI.action.partners.PartnerCreateAction). [30/5/14 12:23:48:839 UTC] 0086 R UOW= source=SystemErr org=IBM prod=WebSphere component=Application Server thread=[WebContainer : 0] log4j:WARN Please initialize the log4j system properly. Below is my property file looks like log4j.logger.org.apache.struts=DEBUG, R log4j.appender.R=org.apache.log4j.RollingFileAppender log4j.appender.R.File=usha.log log4j.appender.R.MaxFileSize=10MB log4j.appender.R.MaxBackupIndex=10 log4j.appender.R.layout=org.apache.log4j.PatternLayout log4j.appender.R.layout.ConversionPattern=[%d{MM/dd/yy HH:mm:ss}] source=%c thread=[%t] %m%n On Fri, May 30, 2014 at 4:48 PM, Christoph Nenning < christoph.nenn...@lex-com.net> wrote: > > Hello Paul. > > > > Now I have configured log4j-1.2.13.jar. Below is my log4j.properties > file > > content. > > > > log4j.rootLogger=DEBUG, R > > log4j.appender.R=org.apache.log4j.RollingFileAppender > > log4j.appender.R.File=usha.log > > log4j.appender.R.MaxFileSize=10MB > > log4j.appender.R.MaxBackupIndex=10 > > log4j.appender.R.layout=org.apache.log4j.PatternLayout > > log4j.appender.R.layout.ConversionPattern=[%d{MM/dd/yy HH:mm:ss}] > source=%c > > thread=[%t] %m%n > > > > I get log file names usha.log created m But it doesnt has any struts > > related logging after I perform the action. Just the below content is > > logged. > > > > [05/30/14 09:14:21] > > source=com.ibm.bcg.consoleUI.action.partners.PartnerCreateAction > > thread=[WebContainer : 3] Logging initialized. > > [05/30/14 09:14:21] > > source=com.ibm.bcg.consoleUI.action.partners.PartnerCreateAction > > thread=[WebContainer : 3] Log4jProperties: C:\Program > > Files\ibm\bcghub-distrib\wasND\Profiles\bcgprofile\installedApps > > \wpgCell\BCGConsole.ear\console.war\WEB-INF\lib\log4j.properties > > > > Which are logged by my action class. > > > > Could you please help if I am missing something. > > > > Thanks > > Usha > > > > > > You need a line like this: > > log4j.logger.org.apache.struts=DEBUG > > > Regards, > Christoph > > This Email was scanned by Sophos Anti Virus >
Re: Struts 1 Logging
now the file is created , but has no trace of struts. below is logged. 05/30/14 12:40:20] source=com.ibm.bcg.consoleUI.action.partners.PartnerCreateAction thread=[WebContainer : 0] Logging initialized. [05/30/14 12:40:20] source=com.ibm.bcg.consoleUI.action.partners.PartnerCreateAction thread=[WebContainer : 0] Log4jProperties: C:\Program Files\ibm\bcghub-distrib\wasND\Profiles\bcgprofile\installedApps\wpgCell\BCGConsole.ear\console.war\WEB-INF\lib\log4j.properties On Fri, May 30, 2014 at 6:00 PM, Christoph Nenning < christoph.nenn...@lex-com.net> wrote: > > Now empty log file is being created. > > > > I see this error in systemout which i printed too > > > > [30/5/14 12:23:48:824 UTC] 0086 R UOW= source=SystemErr org=IBM > > prod=WebSphere component=Application Server thread=[WebContainer : 0] > > log4j:WARN No appenders could be found for logger > > (com.ibm.bcg.consoleUI.action.partners.PartnerCreateAction). > > [30/5/14 12:23:48:839 UTC] 0086 R UOW= source=SystemErr org=IBM > > prod=WebSphere component=Application Server thread=[WebContainer : 0] > > log4j:WARN Please initialize the log4j system properly. > > > > > > Below is my property file looks like > > > > log4j.logger.org.apache.struts=DEBUG, R > > log4j.appender.R=org.apache.log4j.RollingFileAppender > > log4j.appender.R.File=usha.log > > log4j.appender.R.MaxFileSize=10MB > > log4j.appender.R.MaxBackupIndex=10 > > log4j.appender.R.layout=org.apache.log4j.PatternLayout > > log4j.appender.R.layout.ConversionPattern=[%d{MM/dd/yy HH:mm:ss}] > source=%c > > thread=[%t] %m%n > > > > > > > What are you doing? > > Restore the file and just *add* that line. > > > http://logging.apache.org/log4j/1.2/ > > > > Regards, > Christoph > > > This Email was scanned by Sophos Anti Virus >
Re: Struts 1 Logging
property file is in classpath , As the log file is being created with trace. We are not using tomcat. we are using our own webserver which is running on IBM Websphere application server. On Fri, May 30, 2014 at 6:21 PM, Mark Shifman wrote: > > > On 05/30/2014 08:26 AM, Usha Ladkani wrote: > >> Now empty log file is being created. >> >> I see this error in systemout which i printed too >> >> [30/5/14 12:23:48:824 UTC] 0086 R UOW= source=SystemErr org=IBM >> prod=WebSphere component=Application Server thread=[WebContainer : 0] >>log4j:WARN No appenders could be found for logger >> (com.ibm.bcg.consoleUI.action.partners.PartnerCreateAction). >> [30/5/14 12:23:48:839 UTC] 0086 R UOW= source=SystemErr org=IBM >> prod=WebSphere component=Application Server thread=[WebContainer : 0] >>log4j:WARN Please initialize the log4j system properly. >> >> >> Below is my property file looks like >> >> log4j.logger.org.apache.struts=DEBUG, R >> log4j.appender.R=org.apache.log4j.RollingFileAppender >> log4j.appender.R.File=usha.log >> log4j.appender.R.MaxFileSize=10MB >> log4j.appender.R.MaxBackupIndex=10 >> log4j.appender.R.layout=org.apache.log4j.PatternLayout >> log4j.appender.R.layout.ConversionPattern=[%d{MM/dd/yy HH:mm:ss}] >> source=%c >> thread=[%t] %m%n >> > Here is yet another example that I use with struts 1 with some additional > comments. > Here is yet another example of a log4j.properties file that seems to work. > (At least for an example for you to play with) > > log4j.rootCategory=INFO, A2 > # A2 is a DailyRollingFileAppender > # > log4j.appender.A2=org.apache.log4j.DailyRollingFileAppender > log4j.appender.A2.ImmediateFlush=true > log4j.appender.A2.file=${catalina.home}/logs/myapp_log.txt > log4j.appender.A2.datePattern='.'-MM-dd > log4j.appender.A2.append=true > log4j.appender.A2.layout=org.apache.log4j.PatternLayout > log4j.appender.A2.layout.ConversionPattern=%-5p %d{ISO8601} > %M(%F:%L)%n%m%n > > # Set Struts/Commons log level > log4j.logger.org.apache.struts=INFO > log4j.logger.org.apache.commons=INFO > log4j.logger.org.displaytag=WARN > log4j.logger.org.apache.struts.validator=WARN > > log4j.logger.org.apache.commons.validator.GenericTypeValidator=ERROR > log4j.logger.org.apache.struts.chain.commands.servlet.CreateAction=WARN > log4j.logger.org.apache.struts.chain.ComposableRequestProcessor=WARN > log4j.logger.org.apache.struts.action.ActionServlet=WARN > log4j.logger.org.apache.struts.util.PropertyMessageResources=ERROR > log4j.logger.org.apache.struts.action.ActionMapping=ERROR > > log4j.logger.org.exolab.castor.mapping.Mapping=WARN > > The file needs to be in your "classes" directory on you file path > > you also have to make sure that catalina.home is known from somewhere. I > use jsvc to start tomcat as a daemon and have > an tomcat service file (using centos or redhat) that has these lines. > # Source function library. > . /etc/init.d/functions > > # Adapt the following lines to your configuration > CATALINA_HOME=/home/apache-tomcat-7.0.20 > DAEMON_HOME=/home/apache-tomcat-7.0.20/bin > TOMCAT_USER=tomcat > > CATALINA_OPTS=" -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true > -XX:+UseNUMA -XX:+UseParallelGC -Xms1024M -Xmx1024M -XX:MaxPermSize=512M " > CLASSPATH=\ > $JAVA_HOME/lib/tools.jar:\ > $CATALINA_HOME/bin/commons-daemon.jar:\ > $CATALINA_HOME/bin/bootstrap.jar:\ > $CATALINA_HOME/bin/tomcat-juli.jar > ... > I think I had to add "tomcat-juli.jar" to the CLASSPATH above. > > Also there is src code you have to compile to make a "tomcat-juli.jar" > that will understand log4j. > > 2. >> >> Download or build |tomcat-juli.jar| and |tomcat-juli-adapters.jar| >> that are available as an "extras" component for Tomcat. See Additional >> Components documentation <http://tomcat.apache.org/ >> tomcat-7.0-doc/extras.html> for details. >> >> This |tomcat-juli.jar| differs from the default one. It contains the >> full Apache Commons Logging implementation and thus is able to discover the >> presense of log4j and configure itself. >> >> I hope this helps without creating more opacity. > mas > > > >> >> On Fri, May 30, 2014 at 4:48 PM, Christoph Nenning < >> christoph.nenn...@lex-com.net> wrote: >> >> Hello Paul. >>>> >>>> Now I have configured log4j-1.2.13.jar. Below is my log4j.properties >>>> >>> file >>> >>>> content. >>&
Re: Struts 1 Logging
I have the log file created which I have defined in log4j.properties. But I dont see any trace for struts in that File. I only below entries in the log file.- 05/30/14 12:40:20] source=com.ibm.bcg.consoleUI. action.partners.PartnerCreateAction thread=[WebContainer : 0] Logging initialized. [05/30/14 12:40:20] source=com.ibm.bcg.consoleUI.action.partners.PartnerCreateAction thread=[WebContainer : 0] Log4jProperties: C:\Program Files\ibm\bcghub-distrib\wasND\Profiles\bcgprofile\installedApps\wpgCell\BCGConsole.ear\console.war\WEB-INF\lib\log4j.properties On Fri, May 30, 2014 at 6:36 PM, Paul Benedict wrote: > Usha, I don't understand your response. So you have a log file and it's > logging? > > > Cheers, > Paul > > > On Fri, May 30, 2014 at 7:58 AM, Usha Ladkani > wrote: > > > property file is in classpath , As the log file is being created with > > trace. > > > > We are not using tomcat. we are using our own webserver which is running > on > > IBM Websphere application server. > > > > > > On Fri, May 30, 2014 at 6:21 PM, Mark Shifman > > wrote: > > > > > > > > > > > On 05/30/2014 08:26 AM, Usha Ladkani wrote: > > > > > >> Now empty log file is being created. > > >> > > >> I see this error in systemout which i printed too > > >> > > >> [30/5/14 12:23:48:824 UTC] 0086 R UOW= source=SystemErr org=IBM > > >> prod=WebSphere component=Application Server thread=[WebContainer : 0] > > >>log4j:WARN No appenders could be found for logger > > >> (com.ibm.bcg.consoleUI.action.partners.PartnerCreateAction). > > >> [30/5/14 12:23:48:839 UTC] 0086 R UOW= source=SystemErr org=IBM > > >> prod=WebSphere component=Application Server thread=[WebContainer : 0] > > >>log4j:WARN Please initialize the log4j system properly. > > >> > > >> > > >> Below is my property file looks like > > >> > > >> log4j.logger.org.apache.struts=DEBUG, R > > >> log4j.appender.R=org.apache.log4j.RollingFileAppender > > >> log4j.appender.R.File=usha.log > > >> log4j.appender.R.MaxFileSize=10MB > > >> log4j.appender.R.MaxBackupIndex=10 > > >> log4j.appender.R.layout=org.apache.log4j.PatternLayout > > >> log4j.appender.R.layout.ConversionPattern=[%d{MM/dd/yy HH:mm:ss}] > > >> source=%c > > >> thread=[%t] %m%n > > >> > > > Here is yet another example that I use with struts 1 with some > additional > > > comments. > > > Here is yet another example of a log4j.properties file that seems to > > work. > > > (At least for an example for you to play with) > > > > > > log4j.rootCategory=INFO, A2 > > > # A2 is a DailyRollingFileAppender > > > # > > > log4j.appender.A2=org.apache.log4j.DailyRollingFileAppender > > > log4j.appender.A2.ImmediateFlush=true > > > log4j.appender.A2.file=${catalina.home}/logs/myapp_log.txt > > > log4j.appender.A2.datePattern='.'-MM-dd > > > log4j.appender.A2.append=true > > > log4j.appender.A2.layout=org.apache.log4j.PatternLayout > > > log4j.appender.A2.layout.ConversionPattern=%-5p %d{ISO8601} > > > %M(%F:%L)%n%m%n > > > > > > # Set Struts/Commons log level > > > log4j.logger.org.apache.struts=INFO > > > log4j.logger.org.apache.commons=INFO > > > log4j.logger.org.displaytag=WARN > > > log4j.logger.org.apache.struts.validator=WARN > > > > > > log4j.logger.org.apache.commons.validator.GenericTypeValidator=ERROR > > > log4j.logger.org.apache.struts.chain.commands.servlet.CreateAction=WARN > > > log4j.logger.org.apache.struts.chain.ComposableRequestProcessor=WARN > > > log4j.logger.org.apache.struts.action.ActionServlet=WARN > > > log4j.logger.org.apache.struts.util.PropertyMessageResources=ERROR > > > log4j.logger.org.apache.struts.action.ActionMapping=ERROR > > > > > > log4j.logger.org.exolab.castor.mapping.Mapping=WARN > > > > > > The file needs to be in your "classes" directory on you file path > > > > > > you also have to make sure that catalina.home is known from somewhere. > I > > > use jsvc to start tomcat as a daemon and have > > > an tomcat service file (using centos or redhat) that has these lines. > > > # Source function library. > > > . /etc/init.d/functions > > > > > > # Adapt the following lines to your configuration > > > CATALINA
Re: Struts 1 Logging
yes.. below is how property file looks like. log4j.rootLogger=DEBUG, R log4j.logger.org.apache.struts=DEBUG log4j.appender.R=org.apache.log4j.RollingFileAppender log4j.appender.R.File=../updivalidation/UPDISetup.log log4j.appender.R.MaxFileSize=10MB log4j.appender.R.MaxBackupIndex=10 log4j.appender.R.layout=org.apache.log4j.PatternLayout log4j.appender.R.layout.ConversionPattern=[%d{MM/dd/yy HH:mm:ss}] source=%c thread=[%t] %m%n On Fri, May 30, 2014 at 7:02 PM, Dave Newton wrote: > Did you add the line for Struts debugging? > > Dave >
Re: Struts 1 Logging
Alright.. Thanks a lot for your help . Regards Usha On Fri, May 30, 2014 at 7:09 PM, Paul Benedict wrote: > Websphere is notorious for its poor logging support. I used Websphere for > about 5 years. The server exposes Commons Logging in the parent class > loader so it's already configured -- and not configurable by you. That was > my experience, at least. I think you should google "Websphere Struts > Logging" and see what you find. It's a battle but I think you'll be able to > solve it. > > > Cheers, > Paul > > > On Fri, May 30, 2014 at 8:36 AM, Usha Ladkani > wrote: > > > yes.. below is how property file looks like. > > > > log4j.rootLogger=DEBUG, R > > log4j.logger.org.apache.struts=DEBUG > > log4j.appender.R=org.apache.log4j.RollingFileAppender > > log4j.appender.R.File=../updivalidation/UPDISetup.log > > log4j.appender.R.MaxFileSize=10MB > > log4j.appender.R.MaxBackupIndex=10 > > log4j.appender.R.layout=org.apache.log4j.PatternLayout > > log4j.appender.R.layout.ConversionPattern=[%d{MM/dd/yy HH:mm:ss}] > source=%c > > thread=[%t] %m%n > > > > > > > > > > > > > > On Fri, May 30, 2014 at 7:02 PM, Dave Newton > > wrote: > > > > > Did you add the line for Struts debugging? > > > > > > Dave > > > > > >