Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to get notifications for Exceptions in Production Logs ?

 
Sunny Kumar Kalra
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might start by googling for something like log monitoring tool. I believe splunk is one popular option.
 
Damien Dallimore
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there anything in Java API or some Java Framework kind of , which could send some email notifications for the exceptions ?
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
+1 on using a log4j appender for this.
 
Sunny Kumar Kalra
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 48452
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Question too difficult for “beginning”. Moving discussion.
 
Ivan Jozsef Balazs
Rancher
Posts: 972
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20495
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ivan Jozsef Balazs wrote:(You need activation.jar as well.)

javax.activation is part of JSE since Java 6.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic