This week's book giveaway is in the Spring forum.
We're giving away four copies of Spring Boot in Practice and have Somnath Musib on-line!
See this thread for details.
Win a copy of Spring Boot in Practice this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

How to get notifications for Exceptions in Production Logs ?

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ?

 
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You might start by googling for something like log monitoring tool. I believe splunk is one popular option.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
Rancher
Posts: 43028
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
+1 on using a log4j appender for this.
 
Sunny Kumar Kalra
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
Marshal
Posts: 76113
362
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Question too difficult for “beginning”. Moving discussion.
 
Rancher
Posts: 1043
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.)

 
Sheriff
Posts: 22665
127
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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


javax.activation is part of JSE since Java 6.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic