-
Notifications
You must be signed in to change notification settings - Fork 510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Padrino Logger Seems to Bypass boot.rb Config When Running Rake #774
Comments
Mmm also in |
I notice in the Padrino::Cli Base class |
@cnadytruecar should be fixed in |
I'm using 10.0.6, and this issue is still there. Trying to change Logger to output to file inside a rake file: Padrino::Logger::Config[:development] = { :log_level => :devel, :format_datetime => " [%Y-%m-%d %H:%M:%S] ", :stream => :to_file } makes no difference. Log is outputted to console, log/development.log is not being generated. |
Can someone reopen this issue? @DAddYE |
Try this:
Without second line the logger stays the same, it's configured when someone touches If it's enough solution, please close the issue. |
I think that fixes it? I am going to move to 0.11.1 either way but looks like this could be closed. |
I think we should document it better, perhaps adding a commented out example on Btw, was looking at this a bit better and |
A note about configuring the logger in the docs should be enough. Do we have a chapter about configuring the app somewhere? |
Let's just slap in onto github wiki for now: https://github.com/padrino/padrino-framework/wiki/Configuring-the-Logger and then once we have the new site (with markdown guides) we can transfer it easily? We can do similarly for other missing docs right now. |
Brilliant, I've just created that basic page. We will need to explain the options a bit better. |
In boot.rb I'm trying to change the default log location for the logger. Attempt #1 Attempt #2 Attempt #3 I've also tried replacing "default" with "development" just to see if I could get it to work for development at a minimum. I've had no luck so far. Any ideas? |
Hey @Altonymous, Could you try You don't need You would have to make sure the file path to it exists though, e.g.: However, I reckon we could have an easier way and instead of
We would first compare stream against Thoughts? /cc @nesquena |
I gave that a try. It's still not working. Here's what it seems to be doing... It creates development.log and then creates my_custom.log, however, it continues to log to development.log. The creation of my_custom.log is the only thing it does. This is with both with your request and the attempts I made. |
Which version of Padrino are you on? Could you try edge? |
We are already using... gem 'padrino', git: 'https://github.com/padrino/padrino-framework.git', branch: 'master' I just ran bundle update padrino to make sure it's at the latest revision, and the issue is the same. |
Okay I'm getting a little further. Same issue is happening but found this in the logs... org.jruby.rack.RackInitializationException: undefined method Line 16 is currently: When I drop in some puts statements... puts "#{Padrino.root('log', 'adaptor.log')}" # ~/Projects/adaptor/log/adaptor.log |
Well, at least here I don't have a |
I'm not following what you would want me to try? If you are simply asking me to change it from :default to :development, I did that... Padrino::Logger::Config[:development][:stream] = File.new(Padrino.root('log', "my_custom.log"), 'a+') That seems to get it logging to the correct place. So it appears that it's just default I can't set? So instead I'm doing this... Padrino::Logger::Config[PADRINO_ENV.to_sym][:stream] = File.new(Padrino.root('log', "my_custom.log"), 'a+') See any problems with this approach for now? |
Hey @Altonymous, that approach would work alright!.. The reason why
So it will try the environmental variable In your code, you can use |
It worked until we deployed it to one of our lower environments. The Padrino.env is :whiskey for us which is correct. But it returns nil when using: Padrino::Logger::Config[:whiskey]. So I'm not sure how to handle this at the moment. |
In boot.rb, my configuration looks as follows:
Yet the Padrino.logger object looks as follows:
When in the Padrino Console, the object is correct:
I'm looking into this issue, but I wanted to create this issue in the mean time.
The text was updated successfully, but these errors were encountered: