I am trying to config the log to file with the guide from
https://github.com/hanami/hanami/blob/master/lib/hanami/configuration.rb#L1661
module Api
class Application < Hanami::Application
configure do
….
##
# LOGGER
#
logger.stream "../log/#{Hanami.env}.log"
When I run hanami console, I got the error:
in `block in <class:Application>': undefined method `stream' for nil:NilClass (NoMethodError)
I tried to disable the logger customization above, and inspect the logger instance in console, here is the output:
> Api::Application.configuration.logger.stream
NoMethodError: undefined method `stream' for #<Hanami::Logger:0x007f8b4894a158>
Api::Application.configuration.logger.class
=> Hanami::Logger
Seems like a bug.
@duykhoa Hello, which version of Hanami are you using? This feature isn't released yet in stable gem. It will be with v0.8.0.
@duykhoa with 0.7.2, there is a bug with the logic of Hanami::Configuration#logger 0.8.0 fixed it as of https://github.com/hanami/hanami/commits/master/lib/hanami/configuration.rb~~
@jodosha i am pairing with @duykhoa. yes it is feature 0.8.0 that he wants to use on 0.7.2, I am closing it now
@joneslee85 Thanks for letting me know :+1:
Hi guys, this is an awesome feature, I've hard time to stream the log into file. Is there any workaround for this?
@wendy0402 the log currently goes to STDOUT, you could pipe STDOUT to a file when starting your server
Most helpful comment
@wendy0402 the log currently goes to STDOUT, you could pipe STDOUT to a file when starting your server