# Logging Plugin

**URL:** <https://www.ruby-forum.com/t/logging-plugin/173670>\
**Category:** Rails\
**Created:** [August 13, 2009, 4:39am UTC](https://www.ruby-forum.com/t/logging-plugin/173670 "2009-08-13T04:39:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tispratik](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/d78d45/32.png) [@tispratik](https://www.ruby-forum.com/u/tispratik)\
**Post date:** [August 13, 2009, 4:39am UTC](https://www.ruby-forum.com/t/logging-plugin/173670/1 "2009-08-13T04:39:19Z")

</div>

Hi,

Does anyone know how to understand the logs printed in development.rb  
I can understand certain parts of it but not all.

Is there any documentation on it? Or any pretty printing plugin  
available which tells exactly whats going on?.. i mean how can i tell  
if certain objects are fetched from the cache or DB?

Thanks,  
Pratik

---

<div class="post-metadata">

**Author:** ![tispratik](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/d78d45/32.png) [@tispratik](https://www.ruby-forum.com/u/tispratik)\
**Post date:** [August 13, 2009, 3:20pm UTC](https://www.ruby-forum.com/t/logging-plugin/173670/2 "2009-08-13T15:20:38Z")

</div>

Why a plugin for simply reading a log file?

This is the log excerpt for a project ‘show’ with a full cache hit

Processing ProjectsController#show (for 127.0.0.1 at 2009-06-29  
15:41:03) [GET]  
Parameters: {“ft”=\>“project”, “id”=\>“1”}  
Rendering template within layouts/with\_tinymce  
Rendering projects/show  
Cached fragment hit: views/project.1.show (15.0ms)  
User Columns (0.0ms) SHOW FIELDS FROM `users`  
User Load (0.0ms) SELECT \* FROM `users` WHERE (`users`.`id` = 2)  
Cached fragment hit: views/project.1.related (0.0ms)  
Role Columns (0.0ms) SHOW FIELDS FROM `roles`  
blah blah blah…  
Completed in 235ms (View: 219, DB: 0) | 200 OK  
[[http://localhost/projects/1?ft=project](http://localhost/projects/1?ft=project)]

Obviously, I’m getting fragment cache hits, and no DB work (huzzah!) in  
the above case, but not below:

Processing ProjectsController#show (for 127.0.0.1 at 2009-06-29  
15:39:32) [GET]  
Parameters: {“ft”=\>“project”, “id”=\>“1”}  
Cache exist?: views/project.1.show  
Project Columns (0.0ms) SHOW FIELDS FROM `projects`  
Project Load (0.0ms) SELECT \* FROM `projects` WHERE (`projects`.`id` =  
1)  
Cache exist?: views/project.1.related.scenario  
Scenario Columns (0.0ms) SHOW FIELDS FROM `scenarios`  
SQL (0.0ms) SELECT count(_) AS count\_all FROM `scenarios` WHERE  
(`scenarios`.project\_id = 1)  
Scenario Load (0.0ms) SELECT \* FROM `scenarios` WHERE  
(`scenarios`.project\_id = 1) ORDER BY name  
Cache exist?: views/project.1.related.image  
Imagelink Columns (47.0ms) SHOW FIELDS FROM `imagelinks`  
Image Columns (62.0ms) SHOW FIELDS FROM `images`  
SQL (328.0ms) SELECT count(_) AS count\_all FROM `images` INNER JOIN  
`imagelinks` ON `images`.id = `imagelinks`.image\_id WHERE blah blah

… snipped for brevity - there are 10 different models related to a  
project in some fashion, with links to each instance on the project  
‘show’ form, each set of links to other models is a separate cached  
fragment… with telling DB results below

Completed in 3468ms (View: 250, DB: 1763) | 200 OK  
[[http://localhost/projects/1?ft=project](http://localhost/projects/1?ft=project)]
