Greetings all; I''ve just moved my app into production and BackgrounDRb is writing to development.log. The backgroundrb.yml file specifies production, as does environment.rb. A little background (no pun intended ;-0 ) I''m using the ''old'' version of backgroundrb for session management. In the app, whenever a visitor changes pages I record the time in a db record. In the worker, once a second, I''m doing a find for that record. Backgroundrb is logging that find in development.log, not in production.log as I expected. Anybody got any idea what I''ve done wrong? Thanks! Bill -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20070202/f7532abd/attachment.html
An update: I have changed every reference I could find from ''development'' to ''production''. I''ve also changed all references to ''localhost'' to ''127.0.0.1'' as the support folks told me that using localhost in database.yml could cause me problems with MySQL. When I say all, I mean all. That includes the default settings in the start script. And BackgrounDRb is still logging the database selects being performed in the worker to the development.log file instead of production.log. Anybody? Thanks much in advance, Bill ----- Original Message ----- From: Bill Walton To: BackgroundRb Sent: Friday, February 02, 2007 5:34 PM Subject: [Backgroundrb-devel] logging problem in production Greetings all; I''ve just moved my app into production and BackgrounDRb is writing to development.log. The backgroundrb.yml file specifies production, as does environment.rb. A little background (no pun intended ;-0 ) I''m using the ''old'' version of backgroundrb for session management. In the app, whenever a visitor changes pages I record the time in a db record. In the worker, once a second, I''m doing a find for that record. Backgroundrb is logging that find in development.log, not in production.log as I expected. Anybody got any idea what I''ve done wrong? Thanks! Bill ------------------------------------------------------------------------------ _______________________________________________ Backgroundrb-devel mailing list Backgroundrb-devel at rubyforge.org http://rubyforge.org/mailman/listinfo/backgroundrb-devel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20070203/57559fe6/attachment-0001.html
Ezra Zygmuntowicz
2007-Feb-03 21:02 UTC
[Backgroundrb-devel] logging problem in production
Bill- I''m not sure why it is writing to the development log instead of production. But know this, calls to ActiveRecord objects in a worker will still write their sql to the normal rails log. The backgroundrb.log just logs errors and calls to @logger in a worker also log to the backgroundrb.log -Ezra On Feb 3, 2007, at 10:33 AM, Bill Walton wrote:> An update: > > I have changed every reference I could find from ''development'' to > ''production''. I''ve also changed all references to ''localhost'' to > ''127.0.0.1'' as the support folks told me that using localhost in > database.yml could cause me problems with MySQL. When I say all, I > mean all. That includes the default settings in the start script. > And BackgrounDRb is still logging the database selects being > performed in the worker to the development.log file instead of > production.log. > > Anybody? > > Thanks much in advance, > Bill > ----- Original Message ----- > From: Bill Walton > To: BackgroundRb > Sent: Friday, February 02, 2007 5:34 PM > Subject: [Backgroundrb-devel] logging problem in production > > Greetings all; > > I''ve just moved my app into production and BackgrounDRb is writing > to development.log. The backgroundrb.yml file specifies > production, as does environment.rb. > > A little background (no pun intended ;-0 ) I''m using the ''old'' > version of backgroundrb for session management. In the app, > whenever a visitor changes pages I record the time in a db record. > In the worker, once a second, I''m doing a find for that record. > Backgroundrb is logging that find in development.log, not in > production.log as I expected. > > Anybody got any idea what I''ve done wrong? > > Thanks! > Bill > > > _______________________________________________ > Backgroundrb-devel mailing list > Backgroundrb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/backgroundrb-devel > _______________________________________________ > Backgroundrb-devel mailing list > Backgroundrb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/backgroundrb-devel-- Ezra Zygmuntowicz -- Lead Rails Evangelist -- ez at engineyard.com -- Engine Yard, Serious Rails Hosting -- (866) 518-YARD (9273)
Hi Ezra, Ezra Zygmuntowicz wrote:> I''m not sure why it is writing to the development log instead of > production. But know this, calls to ActiveRecord objects in a worker will > still write their sql to the normal rails log.I went to bed last night believing firmly that the problem I''m having lay with my hosted environment and comitted fully to figuring out how to conclusively demonstrate that to them. I woke this morning with a plan, but also realizing that I''d missed an important step in my debugging efforts so far. Everything works fine on my development box in development mode. But I hadn''t tested the behavior on my development box in *production* mode. There is definitely a problem with Backgroundrb in production mode. I am seeing *exactly* the same behavior on my local machine that I''m seeing on my hosted environment. In development mode, everything gets written to development.log. In production mode, the web server logging goes to production.log. But the SQL logging, and not all of it, goes to the development log.
Oops... I wasn''t done. Dang fat fingers ;-) Bill Walton wrote> Hi Ezra, > > Ezra Zygmuntowicz wrote: > >> I''m not sure why it is writing to the development log instead of >> production. But know this, calls to ActiveRecord objects in a worker will >> still write their sql to the normal rails log. > > I went to bed last night believing firmly that the problem I''m having lay > with my hosted environment and comitted fully to figuring out how to > conclusively demonstrate that to them. > > I woke this morning with a plan, but also realizing that I''d missed an > important step in my debugging efforts so far. Everything works fine on > my development box in development mode. But I hadn''t tested the behavior > on my development box in *production* mode. > > There is definitely a problem with Backgroundrb in production mode. > > I am seeing *exactly* the same behavior on my local machine that I''m > seeing on my hosted environment. In development mode, everything gets > written to development.log. In production mode, the web server logging > goes to production.log. But the SQL logging, and not all of it, goes to > the development log.The piece of the app that I''m testing is trivial in terms of size. I''ll send a zip to anyone willing to help by giving it a run on their system. Along, of course, with my eternal gratitude! Best regards to all, Bill
Bill, Have you made any progress on your logging issue? From what i''ve seen on the list this could just as likely be a backgroundrb issue as something in your app. Backgroundrb still has many corner cases where it doesn''t handle the RAILS_ENV variable correctly. I wouldn''t be surprised if it is doing this for everybody but nobody else has been bothered enough/noticed it to report it to the list. If you do identify the location of the problem and it''s in bdrb please take the time to add it to the backgroundrb trac. Have you tried creating an empty rails app, adding backgroundrb and your worker, then using the bdrb console in production mode? -Jacob Bill Walton wrote:> Oops... I wasn''t done. Dang fat fingers ;-) > > Bill Walton wrote > >> Hi Ezra, >> >> Ezra Zygmuntowicz wrote: >> >>> I''m not sure why it is writing to the development log instead of >>> production. But know this, calls to ActiveRecord objects in a worker will >>> still write their sql to the normal rails log. >> I went to bed last night believing firmly that the problem I''m having lay >> with my hosted environment and comitted fully to figuring out how to >> conclusively demonstrate that to them. >> >> I woke this morning with a plan, but also realizing that I''d missed an >> important step in my debugging efforts so far. Everything works fine on >> my development box in development mode. But I hadn''t tested the behavior >> on my development box in *production* mode. >> >> There is definitely a problem with Backgroundrb in production mode. >> >> I am seeing *exactly* the same behavior on my local machine that I''m >> seeing on my hosted environment. In development mode, everything gets >> written to development.log. In production mode, the web server logging >> goes to production.log. But the SQL logging, and not all of it, goes to >> the development log. > > The piece of the app that I''m testing is trivial in terms of size. I''ll > send a zip to anyone willing to help by giving it a run on their system. > Along, of course, with my eternal gratitude! > > Best regards to all, > Bill > > > _______________________________________________ > Backgroundrb-devel mailing list > Backgroundrb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/backgroundrb-devel
Ezra Zygmuntowicz
2007-Feb-06 19:05 UTC
[Backgroundrb-devel] logging problem in production
Yeah Bill solved his problem, he just needed to set RAILS_ENV=production as an env var when starting up backgroundrb. -Ezra On Feb 6, 2007, at 9:50 AM, Jacob Robbins wrote:> Bill, > Have you made any progress on your logging issue? > > From what i''ve seen on the list this could just as likely be a > backgroundrb issue as something in your app. Backgroundrb still has > many > corner cases where it doesn''t handle the RAILS_ENV variable > correctly. I > wouldn''t be surprised if it is doing this for everybody but nobody > else has been bothered enough/noticed it to report it to the list. > > If you do identify the location of the problem and it''s in bdrb > please > take the time to add it to the backgroundrb trac. > > Have you tried creating an empty rails app, adding backgroundrb and > your worker, then using the bdrb console in production mode? > > -Jacob > > Bill Walton wrote: >> Oops... I wasn''t done. Dang fat fingers ;-) >> >> Bill Walton wrote >> >>> Hi Ezra, >>> >>> Ezra Zygmuntowicz wrote: >>> >>>> I''m not sure why it is writing to the development log instead of >>>> production. But know this, calls to ActiveRecord objects in a >>>> worker will >>>> still write their sql to the normal rails log. >>> I went to bed last night believing firmly that the problem I''m >>> having lay >>> with my hosted environment and comitted fully to figuring out how to >>> conclusively demonstrate that to them. >>> >>> I woke this morning with a plan, but also realizing that I''d >>> missed an >>> important step in my debugging efforts so far. Everything works >>> fine on >>> my development box in development mode. But I hadn''t tested the >>> behavior >>> on my development box in *production* mode. >>> >>> There is definitely a problem with Backgroundrb in production mode. >>> >>> I am seeing *exactly* the same behavior on my local machine that I''m >>> seeing on my hosted environment. In development mode, everything >>> gets >>> written to development.log. In production mode, the web server >>> logging >>> goes to production.log. But the SQL logging, and not all of it, >>> goes to >>> the development log. >> >> The piece of the app that I''m testing is trivial in terms of >> size. I''ll >> send a zip to anyone willing to help by giving it a run on their >> system. >> Along, of course, with my eternal gratitude! >> >> Best regards to all, >> Bill >> >> >> _______________________________________________ >> Backgroundrb-devel mailing list >> Backgroundrb-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/backgroundrb-devel > > _______________________________________________ > Backgroundrb-devel mailing list > Backgroundrb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/backgroundrb-devel >-- Ezra Zygmuntowicz -- Lead Rails Evangelist -- ez at engineyard.com -- Engine Yard, Serious Rails Hosting -- (866) 518-YARD (9273)
Hi Jacob, Jacob Robbins wrote:> Have you made any progress on your logging issue?Sorry for my delay in responding. I''ve had my email shut down most of the day. Sometimes very wierd things start happening when Outlook starts receiving during a testing session. As Ezra has already responded with the broad stroke, I''ll just add a little detail. Eden Li was actually the first to suggest the solution. It didn''t show up here because he hit the ''Reply'' button instead of the ''Reply All''. (<rant>I really hate how that varies from list to list</rant>). In my Linux environment, I''m now invoking Backgroundrb using: $ RAILS_ENV=production script/backgroundrb/start -d Note that I''ve used the -d option so I could get the command prompt back to start mongrel from the same PuTTY session. If that''s going to cause me a problem down the road, someone _please_ let me know. ----------------- If anyone can help me understand why the following does not work, I''d be very appreciative. $ RAILS_ENV=production $ rake backgroundrb:start ----------------- On Windows, where I''m doing my development, things are a little trickier. A Command Window doesn''t give you access to the System''s version of the Environment Variables. Any value set in a Command Window is only available in that window. That''s been true since at least Win2K, and I''m pretty sure it started with NT. So I set RAILS_ENV in My Computer -> Properties -> Advanced -> Environment Variables. Best regards, Bill