Agile Web Development

Build it. Launch it. Love it.

Loggers galore

Need more loggers? Loggers Galore allows you to create as many loggers as you require and access them anyplace in your app.

To create a log for sessions and a log for user behavior:

Add a file to /initializers called loggers_galore.rb

In this file you can specify all of the loggers you require like so: Rails.extra_loggers = [:session, :user]

This will create two files in the /log directory called session.log and user.log and add two methods, session_logger and user_logger which can be called anyplace in your app.

All of the usual logger methods apply; debug, info, warn, error, fatal, unknown.

All feedback welcome: dr_gavin@hotmail.com

Copyright (c) 2009 Gavin Morrice, released under the MIT license

Vitals

Home http://handyrailstips.com
Repository git://github.com/GavinM/loggers_galore.git
License Rails' (MIT)
Tags Tag_red
Rating (1 vote)
Owner Gavin Morrice
Created 27 June 2009

Comments

Add a comment