Skip to content
This repository has been archived by the owner on Dec 4, 2021. It is now read-only.

Commit

Permalink
add callback info
Browse files Browse the repository at this point in the history
  • Loading branch information
le0pard committed Apr 22, 2012
1 parent 28c35ec commit 1b2852a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## v0.2.8

* Added callback on exception
* Delete deprecate warnings

## v0.2.7

* Fixed error trace for ruby 1.9.2
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,17 @@ It:
Rails.logger.add_metadata(:user_id => @current_user.id)
end

## Callback on exceptions

For send email or do something on exception you can add callback:

MongodbLogger::Base.configure do |config|
config.on_log_exception do |mongo_record|
# do something with this data, for example - send email (better - by background job)
end
end

In this callback send record without "\_id", because logger not wait for insert response from MongoDB.

## The Front End
To setup web interface in you Rails application, first of all create autoload file in you Rails application
Expand Down

0 comments on commit 1b2852a

Please sign in to comment.