File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes How to get notifications for Exceptions in Production Logs ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to get notifications for Exceptions in Production Logs ?" Watch "How to get notifications for Exceptions in Production Logs ?" New topic
Author

How to get notifications for Exceptions in Production Logs ?

Sunny Kumar Kalra
Greenhorn

Joined: Oct 10, 2010
Posts: 15
Hi All,

We dont have access to production logs and even if we would have access to it , its not possible keep watch on the logs for the Exceptions that might occur. So what all options are there to get notified as soon
as any Exception has occurred ?

Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 6109
    
    6

You might start by googling for something like log monitoring tool. I believe splunk is one popular option.
Damien Dallimore
Greenhorn

Joined: Oct 09, 2012
Posts: 3
Splunk can centrally index your log files and provide real time search capabilitys over TB's of data

You can download, install and start using Splunk for free in 5 mins, http://www.splunk.com/download

Furthermore , all of your "machine data" in your environment can be sent to Splunk and correlated together to give you a really nice single pane of glass transactional view of your production systems.

You can then use Splunk's powerful search language to look for "Exceptions" and create operational views, dashboards, alerts and reports.

As far as getting the logs into Splunk , there are several options, but I would look at these 2.

Splunk Universal Forwarder : http://www.splunk.com/download/universalforwarder
SplunkJavaLogging log4j and logback appenders : http://dev.splunk.com/view/community-projects/SP-CAAAED7
Sunny Kumar Kalra
Greenhorn

Joined: Oct 10, 2010
Posts: 15
Is there anything in Java API or some Java Framework kind of , which could send some email notifications for the exceptions ?
Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 6109
    
    6

Sunny Kumar Kalra wrote:Is there anything in Java API or some Java Framework kind of , which could send some email notifications for the exceptions ?


Nothing built-in, no. Depending on how sophisticated you want to be, you could certainly write the code yourself using the existing classes in the core API (though I think the JavaMail API is part of Java EE, not SE). But why? What objection do you have to using a proven thirdparty tool?
Damien Dallimore
Greenhorn

Joined: Oct 09, 2012
Posts: 3
Sunny Kumar Kalra wrote:Is there anything in Java API or some Java Framework kind of , which could send some email notifications for the exceptions ?


What logging framework are you using ?

If log4j or logback , then they have SMTP Appenders.

So in your code you could catch your exceptions, log them, and have the SMTP appender email them to you.

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39548
    
  27
+1 on using a log4j appender for this.


Ping & DNS - updated with new look and Ping home screen widget
Sunny Kumar Kalra
Greenhorn

Joined: Oct 10, 2010
Posts: 15
We cant use any third party tool/library because needs to get approval from the hierarchy.

Yes we are using log4j. So SMTP appender will be able to send notification on any kind of mail or there are any restrictions ? Like we are using Microsoft Exchange server.

Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36508
    
  16
Question too difficult for “beginning”. Moving discussion.
Ivan Jozsef Balazs
Rancher

Joined: May 22, 2012
Posts: 865
    
    5
Jeff Verdegan wrote:the core API (though I think the JavaMail API is part of Java EE, not SE).


Yes, but it can be used over SE independently from the other EE stuff.
(You need activation.jar as well.)

Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19543
    
  16

Ivan Jozsef Balazs wrote:(You need activation.jar as well.)

javax.activation is part of JSE since Java 6.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to get notifications for Exceptions in Production Logs ?
 
Similar Threads
NOSQL
Catching JSP NullPointerException
Logging Exceptions and Notifications in Production Environment
Checking user selection
Conditional Logging