Extending logging.

1 view
Skip to first unread message

Jason Rojas

unread,
Apr 17, 2008, 12:22:28 AM4/17/08
to ebbebb
I run multiple Mongrel (soon to be Ebb) process behind a load balancer
VIP on multiple servers.
In my rails code (I hacked on it a bit) I add this in the initializer:

def default_log_path
log = if defined? Mongrel and environment == 'production'
ObjectSpace.each_object(Mongrel::HttpServer) { |i| @port =
i.port }
raise "Port could not be introspected!" unless @port and
@port.to_i > 0
"#{environment}.#{@port}.log"
else
"#{environment}.log"
end
File.join(root_path, 'log', log)
end


Obviously this does not work for Ebb.
So, here is the explanation of the code..

Because multiple mongrel processes are writing to one file, log
entries, between Processing and Completed, can become jumbled making
the log files almost impossible to read.

So this code, splits the log files up based on the port number used.
The -l in ebb does not log the production logs, is there any way to
change that? or is there a better place to be looking (in Rack, or
anything else) that could help me figure out this logging issue for
Ebb?

Ry

unread,
Apr 22, 2008, 9:38:49 AM4/22/08
to ebbebb
You need to tell rails where to send it's logs - ebb doesn't really
have any logs of its own (which makes the -l option pretty useless
atm). I guess this would involve modifying ebb/ruby_lib/rack/adapter/
rails.rb. A small patch again HEAD would be gratefully accepted :)

ry

Ry

unread,
Apr 22, 2008, 9:41:20 AM4/22/08
to ebbebb
> that could help me figure out this logging issue for
> Ebb?

if you have questions or problems, bug me more about it
(r...@tinyclouds.org). i can be nettled into action.

Jason Rojas

unread,
Apr 23, 2008, 4:57:07 PM4/23/08
to ebbebb
Thanks for pointing me in the correct direction, maybe i'll try to
make the -l option work a little differently.
Reply all
Reply to author
Forward
0 new messages