Sha256: cb1a601c2fff0827a73cdf4072a1ffb5e5826c64b3a6f9d2b807586c797b9a3f

Contents?: true

Size: 334 Bytes

Versions: 2

Compression:

Stored size: 334 Bytes

Contents

# Patch the Rails::Server log_to_stdout so that it logs via SemanticLogger
require "rails"

module Rails
  class Server
    private
    
    undef_method :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)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rails_semantic_logger-4.9.0 lib/rails_semantic_logger/extensions/rails/server.rb
rails_semantic_logger-4.6.2 lib/rails_semantic_logger/extensions/rails/server.rb