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

how to handle backtrace? #142

Closed
epinault opened this issue Aug 27, 2015 · 7 comments
Closed

how to handle backtrace? #142

epinault opened this issue Aug 27, 2015 · 7 comments
Labels

Comments

@epinault
Copy link

So I am using lograge and the Logstash output format. What I see is the correct json messages in my log files.. but the backtrace is still following in the log. That means logstash receive those line as non json and create json_failure when trying to parse those line. So the issue is the intermingling between json line and non json one.

Is there any best practices I can follow? what would you recommend?

@pxlpnk
Copy link
Collaborator

pxlpnk commented Aug 27, 2015

Hey, in general using an error/exception tracker to record those kinds of events is the best practice here.

What are you planning to to with the stack trace?

@epinault
Copy link
Author

What do you mean by tracker? What I am trying to do is have all the normal traffic line in the log to be printed in Logstash Event format so logstash can parse it and use it in elasticsearch to report. But what I noticed for errors such as backtrace it just print the backtrace as normal line. unfortunately Logstash see them and try to parse them and fails since they are not json format.

I can easily filter them out of the log using a query filter but was curious of best practices. Is it possible to turn the backtrace off? or send them some other way? Backtrace would only be useful for debuggin but nothing else at this point

@dnd
Copy link

dnd commented Sep 9, 2015

I'm with @epinault. I ship my logs to logstash, and even though I also use Airbrake, having the exception that occurred during a request as well as the stacktrace right in my parsed error logs makes diagnosing problems a lot easier.

I would also argue that that exception is part of the request that occurred. It's not its own standalone entity

@benlovell
Copy link
Collaborator

I've been thinking about some solutions to this recently and I'm hoping to have something to play with shortly.

@dnd
Copy link

dnd commented Sep 11, 2015

I look forward to seeing what you come up with. Does this maybe tie in as well with #27?

@epinault
Copy link
Author

What I came up is adding a filter in the logstash to ignore non json message for now

filter {
  if [type] == "feeder" 
  {
    if [message] =~ /^\{/
    {
      json {
        source =>"message"
    add_field => { "category" => "rails_request"}

      }
    }
  }
}

@igstan
Copy link

igstan commented Jun 25, 2018

Hi, folks! Is there any update on this issue? We currently have our backtrace lines interleaved with normal request lines in Kibana and it's not helpful at all.

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

No branches or pull requests

5 participants