Awesome
Synopsis
The central log viewer provides a straightforward interface for viewing log data from the central logger.
- find() queries using the mongo driver API
- grep functionality using find({"key" => /regexp/}) queries
- tail -f behavior
- A configurable listing
Installation
- git clone git://github.com/customink/central_log_viewer.git
- cd central_log_viewer
- cp config/database.yml.sample config/database.yml
- Configure database.yml to point to your mongo db log. See the central_logger README for configuration options and defaults.
- bundle install
Usage
-
The following columns can be specified in the "Listing Fields" text area, separated by comma: action application_name controller ip messages params.<key> path request_time runtime url
-
Other parameters in a logged request can be specified using the "<code>params.<key></code>" format.
-
Checking Tail -f will execute the query every second, appending a <code>{"_id" => {"$gt" => ObjectId("last_object_id")}}</code> clause to the query
Code Overview
This is a Rails 3 application that uses the central_logger gem to configure the mongo driver. A single trivial controller eval()'s the find query and returns JSON to the client for formatting by Handlebars templates. BistroCar is used to dynamically generate JS from several CoffeeScript classes in app/scripts.
Dependencies
- Ruby 1.9.2 (rvm recommended)
- Git 1.6+
- Bundler 1.0+ for dependency management
- haml/sass
Deployment
Author
Copyright (c) 2011 CustomInk, released under the MIT license