• 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
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

Help required to log messages in tomcat :"Not able to log messages to separate files"

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I am not able to log the messages into separate log files in tomcat directory....

I have added following lines into server.xml of tomcat

<Context path="/kxj57" docBase="kxj57" debug="0"
reloadable="true" crossContext="false">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="localhost_kxj57." suffix=".txt"
timestamp="true"/>


I am also using log4j.properties with following lines
#
# Configures Log4j as the Tomcat system logger
#
#
# Configure the logger to output info level messages into a rolling log file.
########################


#log4j.rootLogger=INFO, R

#
# To continue using the "catalina.out" file (which grows forever),
# comment out the above line and uncomment the next.
#
log4j.rootLogger=DEBUG,INFO, A1
#
# Configuration for standard output ("catalina.out").
#######################


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


########################
# Print the date in ISO 8601 format
########################

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

###########
log4j.appender.A1=org.apache.log4j.FileLogger
log4j.appender.A1.DatePattern='.'yyyy-MM-dd


########################
# Edit the next line to point to your logs directory.
# The last part of the name is the log file name.
#
#log4j.appender.R.File=/usr/local/tomcat/logs/tomcat.log
#######################

log4j.appender.A1.File=F:/Program Files/Apache Group/Tomcat 4.1/logs/localhost_kxj57.log
log4j.appender.A1.layout=org.apache.log4j.PatternLayout

########################
# Print the date in ISO 8601 format
########################

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

########################
# Application logging options
#
log4j.logger.org.apache=DEBUG
log4j.logger.org.apache=INFO



Can any body help me how to log messages to separate files so that i can have back up of each and every log
reply
    Bookmark Topic Watch Topic
  • New Topic