MongodbLogger Example

It's Rails application with MongodbLogger gem. Here you can see how it woks and how you can use it.

Web Panel of MongodbLogger

Here you can see MongodbLogger Web panel. After each refresh of this page will be added new log record in MongoDB..

Login: demo Password: password

MongodbLogger Web

Additional Information in logs

If you want to add extra information to the base of the document (let's say something like user_id on every request that it's available), you can just call the Rails.logger.add_metadata method on your logger.

Log additional information

After click on this button, in log will be added hash "{:string => "some_data", :integer => 1, :boolean => true}" by key "additional_data".

You can filter such data like this: Example 1, Example 2, Example 3, Example 4.

Log Exceptions

Here you can see how MongodbLogger log exceptions of Rails app.

Log exceptions

After click on this button you will see rails page with exception. All exceptions you can filter like this.

Log params

Here you can see how MongodbLogger log request params.

After submit this form you can look how MongoDB log this params. Password in filter_parameters, so it's will be filtered also in logs. Attachment will log like hash with "original_filename" and "content_type" keys.