Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have an application in Linux which will log if there is any error in some particular format.

Is there any log-analysis or log-monitoring software in Linux which I can configure it according to my log format so that in case of an error it will send me a alert ?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

One possibility would be to use syslog-ng (it's available for example in Debian, Ubuntu and Gentoo repositories, for RHEL there are downloads on syslog-ng homepage).

syslog-ng allows very flexible syslogging. In your case I would make it match for those errors and make that syslog-ng chain to send out an e-mail / log error to database / send out an SMS or whatever alert mechanism you use.

As a bonus that would be real-time alerting.

share|improve this answer
    
I love syslog-ng (it's the syslog daemon I use everywhere, given the choice, and I've been a happy user for over a decade now), but I wouldn't use it to do the actual monitoring. I'd have all the logs coming in to syslog-ng intially, yes, but then I'd dump them to a database or external file for the actual processing. That gives you a lot more flexibility, and the decoupling can improve performance, too. –  Christopher Cashell Nov 10 '10 at 21:16

For a simple, standalone solution, swatch is designed to attach to the end of a logfile, watch for new lines, and act on them (send email, run scripts ,etc.) depending on the content of those new lines.

share|improve this answer
    
I've used swatch regularly in the past. If you need large scale log monitoring and analysis for a whole system, or for dozens of applications, swatch might not be a perfect choice. But, for keeping an eye on a few logs and looking for a handful of specific cases, it works great. –  Christopher Cashell Nov 10 '10 at 21:12

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.