README.md in lograge-0.0.6 vs README.md in lograge-0.1.0
- old
+ new
@@ -32,11 +32,11 @@
```
you get a single line with all the important information, like this:
```
-GET /jobs/833552.json format=json action=jobs#show status=200 duration=58.33 view=40.43 db=15.26
+method=GET path=/jobs/833552.json format=json controller=jobs action=show status=200 duration=58.33 view=40.43 db=15.26
```
The second line is easy to grasp with a single glance and still includes all the
relevant information as simple key-value pairs. The syntax is heavily inspired
by the log output of the Heroku router. It doesn't include any timestamp by
@@ -68,15 +68,33 @@
# custom_options can be a lambda or hash
# if it's a lambda then it must return a hash
config.lograge.custom_options = lambda do |event|
# capture some specific timing values you are interested in
- {:name => "value", :name => "%2f" % float}
+ {:name => "value", :timing => some_float.round(2)}
end
end
```
+Lograge supports multiple output formats. The most common is the default
+lograge format described above. Alternatively, you can also generate JSON
+logs in the json_event format used by [Logstash](http://logstash.net/).
+
+```
+# config/environments/production.rb
+MyApp::Application.configure do
+ config.lograge.log_format = :logstash
+end
+```
+
+*Note:* When using the logstash output, you need to add the additional gem
+`logstash-event`. You can simply add it to your Gemfile like this
+
+```ruby
+gem "logstash-event"
+```
+
Done.
**Internals**
Thanks to the notification system that was introduced in Rails 3, replacing the
@@ -141,9 +159,12 @@
contemplating, mainly because I want to find a good way to include them, a way
that fits in with the general spirit of the log output generated by Lograge.
**Changes**
+* Add support for Logstash events (Holger Just, http://github.com/meineerde)
+* Fix for Rails 3.2.9
+* Use keys everywhere (Curt Michols, http://github.com/asenchi)
* Add `custom_options` to allow adding custom key-value pairs at runtime (Adam
Cooper, https://github.com/adamcooper)
**License**