Skip to content

Conversation

lifehackett
Copy link

I was finding that more often than not my rails logs were being swallowed by Foreman. This should fix that.

I was finding that more often than not my rails logs were being swallowed by Foreman. This fixes that.
@justin808
Copy link
Member

@lifehackett, this depends on your logging setup. On my projects, which I believe is the Rails default, development.rb typically logs to stdout. Can you paste an example here of a log message in this project that you prefer to see with your setup?

@lifehackett
Copy link
Author

I am just using the default setup as well. If I run rails s in its own terminal window, I get all sorts of useful logging info in the terminal about http requests, db reads/writes, etc... all stuff that comes baked in to Rails. Using foreman, I would only get these log messages ~10% of the time until I added the config in this PR

Example:

10:35:32 web.1 | Started GET "/api/v1/contacts" for 127.0.0.1 at 2015-05-11 10:31:40 -0400 10:35:32 web.1 | Processing by Api::V1::ContactsController#index as JSON 10:35:32 web.1 | Contact Load (0.3ms) SELECT "contacts".* FROM "contacts" 
@justin808
Copy link
Member

Strange, it shouldn't be 10% of the time. Maybe it's due to the log level?

@lifehackett
Copy link
Author

Yes, I thought it was strange too. I tried the log level but that didn't improve things. If no one else is experiencing this problem then feel free to close this PR. I found it very frustrating until I found this solution so thought it might benefit others.

@justin808
Copy link
Member

@lifehackett There's always a reason. The question is whether it's worth the time to figure it out. I've often been stubborn at not letting stuff like this slide by. I always want to know. My skills are where they are today from this attitude.

@justin808
Copy link
Member

I'm going to close this for now. Please re-open if you thein we should include this.

@justin808 justin808 closed this May 21, 2015
@milushov
Copy link
Contributor

milushov commented Jun 23, 2016

@lifehackett

If no one else is experiencing this problem

I have same problem :) exactly as you described

macOS $ ruby -v ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15] $ node -v v0.12.1 $ npm -v 3.9.6 $ foreman -v 0.82.0 $ rails -v Rails 5.0.0.rc1
@justin808
Copy link
Member

@milushov

By any chance do you have the heroku gem running? that will send all logs to stdout.

@milushov
Copy link
Contributor

@justin808 nope, this gem don't event installed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants