lulalala / multi_logger

Create multiple loggers in Rails
MIT License
59 stars 21 forks source link

Problem with Heroku Push #8

Open ZavenArra opened 10 years ago

ZavenArra commented 10 years ago

When I push to Heroku, I get the error Errno::ENOENT: No such file or directory - /tmp/build_1a3e7f9e-d26a-4049-83e3-565c75bab789/log/stack.log

This is my (currently one and only) multilogger log. Ideas as to why this might be ? I've seen mention of other gems having similar errors with heroku push, so it's gotta be this gem.

ZavenArra commented 10 years ago

Didn't an error the first time I pushed, did the second time. Taking the multi logger line out of my initializer got me past the problem. If you can give me a few hints I'd be happy to patch this one.

lulalala commented 10 years ago

Hi there. I have never used Heroku, so I can only assume this is because Heroku tries to prevent apps from creating files (because it want to be a static system). In heroku, how do you view your log files? Do you SSH in to the machine and then CD into the log directory and view the log file?

ZavenArra commented 10 years ago

You view the log files using the heroku client, as you don't have direct access to the filesystem. A similar problem in another gem recommended adding the file in question to version control (one deploys to heroku using git) but this also did not fix the issue..

lulalala commented 10 years ago

So I see that you type heroku logs to access logs. What command do you expect to use access custom logs?

ZavenArra commented 10 years ago

honestly haven't gotten that far with it yet, was going to loo at redirecting multi logger to stdout for heroku. the main thing was just being able to push to heroku without disabling the log i had set up, but you may be on the right rack - how could i simply redirect multi logger to stdout for a certain environment ?

lulalala commented 10 years ago

I guess you can wait for #7 pull request. It will add a way to change logging file path. Then I can add one extra conditional check on top of that, so passing :stdout symbol would actually mean redirecting t to STDOUT

ZavenArra commented 10 years ago

Thanks. I think that what would make the most sense would to be log to STDOUT and also be able to prepend the logfile name to the log output for heroku. I have started looking into how this would be accomplished, not too familiar with the ActiveSupport codebase though.