Sha256: 846509566d78bcde20272aa6f157757eed636e7cdcb5b0ff10c724a80bb2aa80

Contents?: true

Size: 488 Bytes

Versions: 4

Compression:

Stored size: 488 Bytes

Contents

require 'json'
module SemanticLogger
  module Formatters
    class Json < Raw
      # Default JSON time format is ISO8601
      def initialize(time_format: :iso_8601, log_host: true, log_application: true, time_key: :timestamp)
        super(time_format: time_format, log_host: log_host, log_application: log_application, time_key: time_key)
      end

      # Returns log messages in JSON format
      def call(log, logger)
        super(log, logger).to_json
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
semantic_logger-4.3.1 lib/semantic_logger/formatters/json.rb
semantic_logger-4.3.0 lib/semantic_logger/formatters/json.rb
semantic_logger-4.2.2 lib/semantic_logger/formatters/json.rb
semantic_logger-4.2.1 lib/semantic_logger/formatters/json.rb