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