aspose file tools
The moose likes Servlets and the fly likes how to log errors occurred in backend java engine or servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "how to log errors occurred in backend java engine or servlet" Watch "how to log errors occurred in backend java engine or servlet" New topic
Author

how to log errors occurred in backend java engine or servlet

Rahul P Kumar
Ranch Hand

Joined: Sep 26, 2009
Posts: 188
Sometimes due to internal engine or java heap space or null pointer exception, jsp page shows the complete stack trace. So I configured the error page, registered that in web.xml through <error-page> tag. But I want those error to be logged in my designated log file or better email to me. How to do that? Please help me.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56215
    
  13

Log4J


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Rahul P Kumar
Ranch Hand

Joined: Sep 26, 2009
Posts: 188
Bear Bibeault wrote:Log4J

If I will put logger in my simpleController class, which takes action based on requested jsp, will it be enough to log stated exceptions. BTW, I've already logger configured, though exceptions caught are standard one (IOException and ServletException). Do you think, if I will use "throws NullPointerException or OutOfMemoryError", it will be logged or say catch them and log the stacktrace, it will solve the purpose. Well I've tried with NullPointerException (thrown and catched), but there was no logging in my log4J. Only logging is in tomcat logger ("localhost....") and that is every time irrespective of logger configured or not.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: how to log errors occurred in backend java engine or servlet
 
Similar Threads
HashMap problem
Logging message
getting data from a form directly
How to link Apache And Resin
Error Handler