Incomplete log messages

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?

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

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

–Jeremy

On 2/13/07, bjhess [email protected] 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/

My free Ruby e-book:
http://www.humblelittlerubybook.com/book/

My blogs:

http://www.rubyinpractice.com/

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” [email protected]

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

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:

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

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

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