• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

not able to print log4j messsages to tomcat console

 
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi , i am trying log4j for the 1st time but stuck at 1 point.not able to print log4j messages to tomcat console.

i have included log4j-1.2.9.jar,commons-logging.jar in my classpath as well as in webinf/lib folder. my log4j.properties file is der in classes folder

and it looks like
-----------------------------------------------------------------
log4j.rootCategory=ERROR, stdout
log4j.logger.net.reumann.demo=DEBUG, rolling

log4j.additivity.com.template=false

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout

log4j.appender.stdout.layout.ConversionPattern=%-5p [%t] %c %M- %m%n

log4j.appender.rolling=org.apache.log4j.RollingFileAppender
log4j.appender.rolling.File=${catalina.home}/logs/SpringIBatis.log
log4j.appender.rolling.MaxFileSize=500kb
log4j.appender.rolling.MaxBackupIndex=3
log4j.appender.rolling.layout=org.apache.log4j.PatternLayout
log4j.appender.rolling.layout.ConversionPattern=%d{MM/dd/yy hh:mm:ss a } %-5p %C %M - %m%n

in my class i have written like
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

private Log logger = LogFactory.getLog(this.getClass());
logger.debug("**************Get All Employee*********************");

--------------------------------------------------------------------------

but when i run the application i cant get anything in my tomcat console .
Can anybody help me to find out my mistake

Thanks
Nishita
 
bacon. tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic