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

Rails.logger.info shows no timestamp #306

Open
ashuSvirus opened this issue Nov 26, 2019 · 1 comment
Open

Rails.logger.info shows no timestamp #306

ashuSvirus opened this issue Nov 26, 2019 · 1 comment

Comments

@ashuSvirus
Copy link

My lograge configuration look as below

    config.lograge.enabled = true
    config.lograge.base_controller_class = ['ActionController::Base']
    config.lograge.formatter = Lograge::Formatters::Logstash.new

But whenever i use Rails.logger.info("this is my log string"), in log files it comes like this

this is my log string
{"method":"GET","path":"/some-api","format":"json","controller":"controller-some","action":"ping","status":200,"duration":3.72,"view":0.41,"db":0.0,"transaction.id":null,"span.id":null,"trace.id":null,"params":{},"exception":null,"exception_object":null,"remote_ip":"127.0.0.1","@timestamp":"2019-11-26T09:53:12.184Z","@version":"1","message":"[200] GET /some-api"}

I want to append timestamp before all Rails.logger. entries.

@bhushan-ahire
Copy link

Any update on this?

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

No branches or pull requests

2 participants