Adding user name to production log?

All,

In the production log I have entries like:

Processing OpportunityController#new (for 68.213.19.251 at 2006-05-11
10:18:36) [GET]
Session ID: 345b455a2a36af8814081c388d8726f1
Parameters: {“action”=>“new”, “controller”=>“opportunity”}
Rendering within layouts/opportunity
Rendering opportunity/new
Completed in 0.02281 (43 reqs/sec) | Rendering: 0.01585 (69%) | DB:
0.00271 (11%) | 200 OK [https://68.213.19.251/opportunity/new]

I would like to add the user’s login name. Is there an easy way for
me to extend the above and add it? Obviously I have it in a session
variable, I just don’t know where to add the log statement.

Greg

Greg F.
The Norcross Group
Forensics for the 21st Century

On May 11, 2006, at 12:12 PM, Greg F. wrote:

Completed in 0.02281 (43 reqs/sec) | Rendering: 0.01585 (69%) | DB:
0.00271 (11%) | 200 OK [https://68.213.19.251/opportunity/new]

I would like to add the user’s login name. Is there an easy way for
me to extend the above and add it? Obviously I have it in a session
variable, I just don’t know where to add the log statement.

Coincidentally, I did this the other day from inside an around filter
by writing something like:

controller.logger.info “blah blah blah”

in the before method.

Don’t know if there’s a better way.

Cheers,
Bob

Greg

Greg F.
The Norcross Group
Forensics for the 21st Century


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails


Bob H. – blogs at <http://www.recursive.ca/
hutch/>
Recursive Design Inc. – http://www.recursive.ca/
Raconteur – http://www.raconteur.info/
xampl for Ruby – http://rubyforge.org/projects/xampl/

A better way? That’s one very simple line of code. You can’t get much
better than that.
-N