# Incomplete log messages

**URL:** <https://www.ruby-forum.com/t/incomplete-log-messages/85250>\
**Category:** Deployment\
**Created:** [February 11, 2007, 11:47pm UTC](https://www.ruby-forum.com/t/incomplete-log-messages/85250 "2007-02-11T23:47:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bjhess](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/ce7236/32.png) [@bjhess](https://www.ruby-forum.com/u/bjhess)\
**Post date:** [February 11, 2007, 11:47pm UTC](https://www.ruby-forum.com/t/incomplete-log-messages/85250/1 "2007-02-11T23:47:57Z")

</div>

I’m not sure if this belongs here. It is in reference to an app  
“deployed” on my local machine. The general Rails group had no advice  
on the topic, though.

I’m in the process of switching from Windows XP to OS X, and since  
I’ve moved to OS X my log messages have been incomplete. This timing  
may be coincidence, but somehow I doubt it.

Anyway, I’ve tried running my app locally under both webrick and  
mongrel with the same results. All I see in my development.log is  
something like the following:

DEBUG Wed Feb 07 06:14:37 -0600 2007 (2132)

DEBUG Wed Feb 07 06:14:37 -0600 2007 (2132)

DEBUG Wed Feb 07 06:14:37 -0600 2007 (2132)

DEBUG Wed Feb 07 06:14:37 -0600 2007 (2132)

DEBUG Wed Feb 07 06:14:37 -0600 2007 (2132)

DEBUG Wed Feb 07 06:14:37 -0600 2007 (2132)

DEBUG Wed Feb 07 06:14:37 -0600 2007 (2132)

INFO Wed Feb 07 06:14:37 -0600 2007 (2132)

The debug headers are spitting out, but the debug message is not. So  
basically I have zero shot at debugging my app. Anyone know a way to  
resolve this?

---

<div class="post-metadata">

**Author:** ![bjhess](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/ce7236/32.png) [@bjhess](https://www.ruby-forum.com/u/bjhess)\
**Post date:** [February 13, 2007, 4:20pm UTC](https://www.ruby-forum.com/t/incomplete-log-messages/85250/2 "2007-02-13T16:20:11Z")

</div>

I am also receiving this lack of messaging on my Dreamhost deployment.

---

<div class="post-metadata">

**Author:** ![bjhess](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/ce7236/32.png) [@bjhess](https://www.ruby-forum.com/u/bjhess)\
**Post date:** [February 13, 2007, 5:08pm UTC](https://www.ruby-forum.com/t/incomplete-log-messages/85250/3 "2007-02-13T17:08:18Z")

</div>

Are these just your logging attempts or also Rails (e.g.,  
ActiveRecord’s benchmarking and query output)?

–Jeremy

On 2/13/07, bjhess [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > I’ve moved to OS X my log messages have been incomplete. This timing  
> > DEBUG Wed Feb 07 06:14:37 -0600 2007 (2132)
> > 
> > The debug headers are spitting out, but the debug message is not. So  
> > basically I have zero shot at debugging my app. Anyone know a way to  
> > resolve this?
> 
> >

–  
[http://www.jeremymcanally.com/](http://www.jeremymcanally.com/)

My free Ruby e-book:  
[http://www.humblelittlerubybook.com/book/](http://www.humblelittlerubybook.com/book/)

My blogs:

> **[Site not found · DreamHost](http://www.mrneighborly.com/)**
>
> The owner of this domain has not yet uploaded their website.

[http://www.rubyinpractice.com/](http://www.rubyinpractice.com/)

---

<div class="post-metadata">

**Author:** ![bjhess](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/ce7236/32.png) [@bjhess](https://www.ruby-forum.com/u/bjhess)\
**Post date:** [February 15, 2007, 8:49pm UTC](https://www.ruby-forum.com/t/incomplete-log-messages/85250/4 "2007-02-15T20:49:04Z")

</div>

I actually have it down to where I don’t have any logging in the app,  
so it’s only Rails logging left and still I have no output.

Thanks,

Barry

On Feb 13, 9:53 am, “Jeremy McAnally” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![bjhess](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/ce7236/32.png) [@bjhess](https://www.ruby-forum.com/u/bjhess)\
**Post date:** [February 20, 2007, 3:58am UTC](https://www.ruby-forum.com/t/incomplete-log-messages/85250/5 "2007-02-20T03:58:27Z")

</div>

Anyone else experience missing log messages on a host or locally?

---

<div class="post-metadata">

**Author:** ![bjhess](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/ce7236/32.png) [@bjhess](https://www.ruby-forum.com/u/bjhess)\
**Post date:** [February 20, 2007, 9:07pm UTC](https://www.ruby-forum.com/t/incomplete-log-messages/85250/6 "2007-02-20T21:07:56Z")

</div>

I’ve solved my problem. Thanks to everyone who read these ramblings -  
sorry for bugging you all. Right up front, I did not share all of the  
right information because frankly I did not know I had it.

For instance, I did not share that I had redefined the Logger’s  
format\_message method to improve my logger output. My definition was  
as follows:

class Logger  
def format\_message(severity, timestamp, msg, progname)  
“#{severity} #{timestamp} (#{$$})\n #{msg}\n”  
end  
end

It took me quite a while to figure out what was wrong with the above.  
I tried some other folks’ format\_message definitions with no luck:

> **[Ruby's classes are dynamic](http://michaelmarth.blogspot.com/2006/07/rubys-classes-are-dynamic.html)**
>
> One way cool feature of Ruby is that classes can be modified dynamically. I got a chance to use this feature today when I needed to change t...

[http://dev.rubyonrails.org/ticket/2245](http://dev.rubyonrails.org/ticket/2245)

Then I found that Ruby 1.8.3 had transposed the msg and progname  
arguments:

[http://devblog.famundo.com/articles/2006/09/22/improving-the-rails-logger](http://devblog.famundo.com/articles/2006/09/22/improving-the-rails-logger)

Making the format look like what is depicted at the Wiki:

[http://wiki.rubyonrails.com/rails/pages/HowtoConfigureLogging](http://wiki.rubyonrails.com/rails/pages/HowtoConfigureLogging)

Certainly this problem occurred because I went to a new Ruby version  
on my new MacBook and coincidentally Dreamhost upgraded Ruby  
recently. So the new format\_message method is simply:

class Logger  
def format\_message(severity, timestamp, progname, msg)  
“#{severity} #{timestamp} (#{$$})\n #{msg}\n”  
end  
end

-Barry
