logging warnings (not errors) in a rails application, and managing them

I'm looking for a good process to handle warnings/info type messages in Rails applications. For example, how many times users type in the wrong password, how many times validations for models fail, etc. Particularly, I'm looking for an efficient way to operationalize these metrics, since they aren't exceptions but could indicate potential bugs or issues in functionality.

Solutions I'm kicking around are:

  • Logging WARNING or INFO messages and using Splunk to parse them (unfortunately Splunk is ver expensive)
  • Sending Airbrake errors in a WARNING environment

  • You should have a look at Papertrail as an alternative to Splunk+Airbrake. Seems like a better fit if you're just interested in logging.


    Another approach to this would be to use something like StatsD paired with Librato (or the open source alternative of Graphite ). StatsD (and consequently Librato / Graphite ) operate over UDP so it's an incredibly cheap way to instrument as much as you want for things like failed logins or users being created. You can implement down to the timing of individual blocks of code as well as just saying "this method was called."

    This is an approach that Etsy pushed forwards about 3 years ago and basically allows you to get an application "heart beat" to use for monitoring when deploys have gone wrong or functionality is not working as intended/is normal. On top of all of that, it's a great way to get easy "executive" style dashboards to show that everything is working as intended and that the application is healthy.


    Disclaimer: my company built, owns and operates Instrumental.

    We use Instrumental internally for tracking how often bugs occur (we actually used Instrumental to track down and squash a signup bug recently) and tracking down other issues that aren't actual exceptions.

    A Rails implementation is super easy (we're Rails guys, too, so we made a Gem):

    https://github.com/fastestforward/instrumental_agent

    You'd just want to add some instrumentation around the thing you'd like to measure (wrong password entry, or failing validations, in this case.)

    Some documentation about measurement for errors, bugs and other events:

    https://instrumentalapp.com/docs

    链接地址: http://www.djcxy.com/p/10896.html

    上一篇: 从C#中撤销访问

    下一篇: 在Rails应用程序中记录警告(而不是错误)并对其进行管理