[Mongrel] mongrel logging on win32 platform and win32 service

linux user fanoflinux at gmail.com
Fri Aug 25 12:23:15 EDT 2006


On 8/25/06, Luis Lavena <luislavena at gmail.com> wrote:
>
> 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


I will try this, but since all my 4 mongrels on a single machine start from
the same application-root, this would cause out of sequence statements in
log/request.log. It would have been so much better to have logging on win32
where each mongrel will have its own log.

Or may be I should just start each mongrel from a different application-root
folder but for that I will have use ActiveRecordStore for session
synchronization and I can't use file store anymore.

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?


I do have lighty in front of 4 mongrels. nginx is not supported on win32.

> 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.


I am not cross posting atleast not in the last 4-5 replies.

--
> 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
> _______________________________________________
> Mongrel-users mailing list
> Mongrel-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/mongrel-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20060825/8b70e584/attachment-0001.html 


More information about the Mongrel-users mailing list