• Post Reply Bookmark Topic Watch Topic
  • New Topic

Logging ..adivse  RSS feed

Srinivasa Kadiyala
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have my log4j.properties file as below:

<<<<<<<<<<<<<log4j.props file>>>>>>>>>>>>>>>>>>>>>>
log4j.rootLogger=info, stdout, R

# Pattern to output the caller's file name and line number.
#log4j.appender.stdout.layout.ConversionPattern=%d %-5p %c "%l" %x - %m%n
log4j.appender.stdout.layout.ConversionPattern=%d %-5p %c{2} %x - %m%n

# Set appender for log files
# Keep one backup file

#log4j.appender.R.layout.ConversionPattern=%d %-5p %c %l - %m%n
log4j.appender.R.layout.ConversionPattern=%d %-5p %c{2} - %m%n

<<<<<<<<<<<<<<<<<< ends here>>>>>>>>>>>>>>>>>>

<<<<<<<<<<<<<<<LogInit servlet>>>>>>>>>>>>>>>>>>>

public class LogInitServlet extends HttpServlet {

// private Logger log = Logger.getLogger(LogInitServlet.class);

public void init() {

// log.info("*********Invoked Logging*************");
String prefix = getServletContext().getRealPath("/");
String config = getInitParameter("log4j-init-file");
// log.info("Initializing Log4j from config file: " + prefix + config);

if (config != null) {
PropertyConfigurator.configure(prefix + config);

public void doGet(HttpServletRequest request, HttpServletResponse response) {


<<<<<<<<<<<<< ends here>>>>>>>>>>>>>>>>>>>>>>>>>>>>

<<<<< added to web.xml>>>>>>>>>>>>>>>>>>

<<<<<<<<<<<<<<<<<<ends here>>>>>>>>>>>>>>>>>>>>>>>>

The directory and file name exists on the dev server.

The logging is working fine when I execute the code on Tomcat on my m/c. But when I push to dev server, it is not writting to myApp.log.

Appreciate help.
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!