Logging a Message in a Servlet - Java Servlet JSP

Java examples for Servlet JSP:Servlet

Description

Logging a Message in a Servlet


// Add an entry to the log file
getServletContext().log("A message");

try {
    // ...
} catch (Exception e) {
    // Add an entry to the log file and include an exception
    getServletContext().log("An exception occurred", e);
}

Related Tutorials