Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove pre-pending severity level in log entries #55

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nguyenmv2
Copy link

"severity={level}" is added to the beginning of the log by default, which causes JSON logs to be interpreted as KeyValue.

"severity={level}" is added to the beginning of the log by default, which causes JSON logs to be interpreted as KeyValue.
@StephenHynes7
Copy link
Contributor

Ideally we would want this configureable since we will lose information if we completely remove this line. Do you think that is something you can look into doing?

DrMavenRebe added a commit to DrMavenRebe/le_ruby that referenced this pull request Jan 11, 2017
@jkgraham
Copy link

I was able to get around this by overriding the formatter (in Rails):

  # config/environments/production.rb
  class CustomLogFormatter < Logger::Formatter
    def call(severity, datetime, progname, msg)
      "#{datetime} level=#{severity.downcase} #{msg2str(msg)}"
    end
  end
  
  le_logger = Le.new('123123-123123-123123')
  le_logger.formatter = CustomLogFormatter.new
  config.logger = le_logger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants