0.0
No commit activity in last 3 years
No release in over 3 years
Monitoring log and alert with email, webpost, file or console.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

LogMonitor

Monitoring web server's log. And raise alert with email, webpost, file, or console.

Install

  • Add
gem "log-monitor"

to Gemfile.

Usage

As RAILS plugin

  • Create config/log-monitor.yml
monitor:
  target: /tmp/log/development.log
  words:
    - Completed 500 Internal Server Error
    - No route matches
method: file # ,console, email or webpost
file: /tmp/log-monitor.log
webpost: http://localhost:3000/monitor/post # ignored which not selected as method
email: # ignored which not selected as method
  to:
    - *@*.com
  from: *@gmail.com
  subject: Alert! *.com Error occured!
  address: smtp.gmail.com
  port: 587
  user_name: *@gmail.com
  password: [password]
  • Create config/initializers/log-monitor.rb
require 'log_monitor'

Thread.new do
  config_file = Rails.root.join('config', 'log-monitor.yml')
  config = YAML.load_file(config_file)#[Rails.env]
  alerter = LogMonitor::Factory.get(config)
  alerter.monitor
end

As standalone application

  • Create log-monitor.yml
monitor:
  target: /tmp/log/development.log
  words:
    - Completed 500 Internal Server Error
    - No route matches
method: file # ,console, email or webpost
file: /tmp/log-monitor.log
webpost: http://localhost:3000/monitor/post # ignored which not selected as method
email: # ignored which not selected as method
  to:
    - *@*.com
  from: *@gmail.com
  subject: Alert! *.com Error occured!
  address: smtp.gmail.com
  port: 587
  user_name: *@gmail.com
  password: [password]
  • Run log-monitor log-monitor.yml

System requirement

  • Ruby 2.0 or later.
  • RoR 4.1 or later.
  • tlsmail.

License

Copyright © 2014 Jun’ya Shimoda(JironBach) Licensed under the MIT license.