3 Replies Latest reply on May 23, 2007 6:33 PM by 807606

    log4j - eclipse versus stand alone app

      Hi Folks, I have a program that runs in eclipse and uses log4j to write to a
      log file correctly. But when I run as a stand alone app outside of eclipse
      (command line) the log file is not created. Instead logging is written to
      the console. I suspect the log4j.xml is not found but it is in my
      classpath. Any thoughts? Joe

      The Code:
      Log log = LogFactory.getLog( DocumentRequestor.class );
      log.info("Start of Batch Cylce ");

      The log4j.xml:
      <?xml version="1.0" encoding="UTF-8" ?>
      <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

      <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">

      <appender name="rollingFileOutput"
      <param name="File" value="AutomatedFileDelivery.log"/>
      <param name="DatePattern" value="'.'yyyy-MM-dd"/>
      <layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern" value="%d - %m%n"/>

      <priority value ="info" />
      <appender-ref ref="rollingFileOutput"/>