[Mongrel] mongrel logging on win32 platform and win32 service

Luis Lavena luislavena at gmail.com
Fri Aug 25 12:14:49 EDT 2006


On 8/25/06, linux user <fanoflinux at gmail.com> wrote:
[snip]
>
> Luis
>
>
> I should have checked the timestamp of production.log last time when I
> started mongrel -e production.
>  Thanks I think I have solved the problem and I have found the conflicting
> option, but I have no decent explaination for it. Here is what I did
>
> 1. In my original application I deleted all log file and mongrel_debug
> folder and restarted mongrel
>
> in my config/environment/production.rb I have
> config.log_level = :debug
> config.log_path = 'log/production_debug.log'
>
> At this time the log folder has only one log file 'production_debug.log' and
> folder 'mongrel_debug' with 'files.log'. So I get all the output from logger
> (at debug level) in 'log/production_debug.log'.
>
> But I still get the output from 'puts, p, print' on the console and nowhere
> in any log file.
>
> 2. If I remove the logger configuration from my
> config/environments/production.rb, I still get output from
> 'puts, p, print' on the console. The only content on production.log at this
> time is (mostly statistical)
> Processing SnapshotController#print_letters (for 127.0.0.1
> at 2006-08-25 10:51:17) [GET]
>   Session ID: 022a23172e2328c2ba29f36a65e1ecbe
>   Parameters: {"action"=>"print_letters", "controller"=>"snapshot"}
> Redirected to http://localhost:4111/snapshot/letter/list
> Completed in 0.00010 (10000 reqs/sec) | DB: 0.00000 (0%) | 302 Found [
> http://localhost/snapshot/snapshot/print_letters]
>
> I still need to capture the output on console to a log file, don't know how
> to do it.
>
> Are you able to capture output from 'puts, p, print' on the console to a log
> file???
>

puts, p and print are directed to STDOUT, so a simple redirect in your
production.rb will do:

STDOUT.reopen("log/request.log", 'a+')
STDOUT.sync=true

That will do, unless mongrel is using STDERR to output to console,
which I doubt.

Are you plaining serve mongrel directly to the world? why not apache
or lighty? or even nginx?

> thanx a megaton for helping me.
>

A suggestion: stop cross-posting between rails and mongrel list. If
the problem is mongrel related, post here, if rails related, there,
but try one place at a time.

-- 
Luis Lavena
Multimedia systems
-
Leaders are made, they are not born. They are made by hard effort,
which is the price which all of us must pay to achieve any goal that
is worthwhile.
Vince Lombardi


More information about the Mongrel-users mailing list