Sha256: da34ffaec96a06b1f9998074ac691c3242e0b70db61c33be7ee5bd3b4930039f

Contents?: true

Size: 413 Bytes

Versions: 4

Compression:

Stored size: 413 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 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?
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rails_semantic_logger-4.17.0 lib/rails_semantic_logger/extensions/rails/server.rb
rails_semantic_logger-4.16.0 lib/rails_semantic_logger/extensions/rails/server.rb
rails_semantic_logger-4.15.0 lib/rails_semantic_logger/extensions/rails/server.rb
rails_semantic_logger-4.14.0 lib/rails_semantic_logger/extensions/rails/server.rb