Consider the code for doGet method of a
servlet.
Which of the given LOCs can be inserted at //1 to log the message as well as the exception's stack trace?
1. req.log(e, "Unknown User");
2.req.log(e, "Unknown User");
3.this.getServletContext().log("Unknown User",e);
4.this.getServletContext().log(e, "Unknown User");
5.The stack trace of the exception cannot be logged using log(...) methods.
Correct answer is 3.
But I say it should also be 4.
As, in ServletContext we have message log(Exception e,
String message)