It looks like you're using one of the newer versions of Syslog.  I only have 
experience with an older version that did not use an XML config file.

My first guess after looking at your code is that ServletContext.getRealPath() is not 
returning what you think it should.  Have you tried writing this path to System.out so 
you could see if it's correct?

Cheers,
Eric 
--

On Tue, 10 Apr 2001 15:11:32  
 Diego Amicabile wrote:
>This is the LoggerServlet which is loaded on startup
>
>public class LoggerServlet extends HttpServlet {
>  private static final String CONTENT_TYPE =
>"text/html";
>  /**Initialize global variables*/
>  public void init(ServletConfig config) throws
>ServletException {
>    super.init(config);
>    try {
>      System.out.println("Trying to read configuration
>file");
>      Syslog.configure(new
>File(getServletContext().getRealPath("/WEB-INF/logger.xml")));
>     
>Syslog.setLogMask(Syslog.atOrAbove(Syslog.DEBUG));
>      Syslog.debug(this,"LoggerServlet started");
>    } catch (SyslogInitException sie) {
>      sie.printStackTrace();
>    }
>  }
>  /**Clean up resources*/
>  public void destroy() {
>  }
>}
>
>This is my configuration file
>
><Syslog defaultMask="DEBUG"> 
>
>    <Logger name="myPrintWriterLog" 
>      class="com.protomatter.syslog.PrintWriterLog" 
>    > 
>
>      <stream>System.out</stream> 
>
>      <Policy
>class="com.protomatter.syslog.SimpleLogPolicy"> 
>        <channels>ALL_CHANNEL</channels> 
>        <logMask>INHERIT_MASK</logMask> 
>      </Policy> 
>
>      <Format 
>class="com.protomatter.syslog.SimpleSyslogTextFormatter">
>
>        <showChannel>true</showChannel> 
>        <showHostName>false</showHostName> 
>      </Format> 
>
>    </Logger> 
>
>  
>
>    <!-- as many logger definitions as needed --> 
>
>  </Syslog> 
>
>When I start the web application the message "Trying
>to read configuration file"  appears, no exception is
>thrown, so I assume the configuration file is read,
>but nothing is written afterwards - so the Syslog does
>not work!
>
>Greetings 
>Diego
>
>
>______________________________________________________________________
>Do You Yahoo!?
>Il tuo indirizzo gratis e per sempre @yahoo.it su http://mail.yahoo.it
>
>


Get 250 color business cards for FREE! at Lycos Mail
http://mail.lycos.com/freemail/vistaprint_index.html

Reply via email to