-
-
Notifications
You must be signed in to change notification settings - Fork 137
Open
Description
Hi @reidmorrison, I'm a huge fan of your project!
I was wondering, is there a reason why the following three snippets of code don't take the log format from the Options:
| module Rails | |
| class Server | |
| private | |
| undef_method :log_to_stdout if method_defined?(:log_to_stdout) | |
| def log_to_stdout | |
| wrapped_app # touch the app so the logger is set up | |
| SemanticLogger.add_appender(io: $stdout, formatter: :color) unless SemanticLogger.appenders.console_output? |
rails_semantic_logger/lib/rails_semantic_logger/engine.rb
Lines 116 to 125 in fb9bd70
| ::Sidekiq.configure_server do |config| | |
| config.logger = ::SemanticLogger[::Sidekiq] | |
| if config.respond_to?(:options) | |
| config.options[:job_logger] = RailsSemanticLogger::Sidekiq::JobLogger | |
| else | |
| config[:job_logger] = RailsSemanticLogger::Sidekiq::JobLogger | |
| end | |
| # Add back the default console logger unless already added | |
| SemanticLogger.add_appender(io: $stdout, formatter: :color) unless SemanticLogger.appenders.console_output? |
rails_semantic_logger/lib/rails_semantic_logger/engine.rb
Lines 269 to 275 in fb9bd70
| console do |_app| | |
| # Don't use a background thread for logging | |
| SemanticLogger.sync! | |
| # Add a stderr logger when running inside a Rails console unless one has already been added. | |
| if config.rails_semantic_logger.console_logger && !SemanticLogger.appenders.console_output? | |
| SemanticLogger.add_appender(io: STDERR, formatter: :color) | |
| end |
Metadata
Metadata
Assignees
Labels
No labels