3

I'm using Rails.logger.error to log my errors. I'm trying to view them in my logs and in heroku's logentries addon byt I see they are logged as simple text. No indication that this is in fact an error and Logentries isn't picking it up as an error either.

Any idea why this is? How should I be logging my errors for easy finding later?

Thanks! Uri

infused
  • 24,000
  • 13
  • 68
  • 78
Uri Klar
  • 3,800
  • 3
  • 37
  • 75
  • What do you mean by "as simple text"? Logs are almost always plain text, line delimited, files. What does the log contain now and how did you expect it to look? – zeebonk Jun 23 '14 at 11:28
  • Well, i guess you're right. My problem is, and i'll edit the question, that the Logentries heroku add on isn't recognizing these lines as errors, even though they are logged as Rails.logger.error – Uri Klar Jun 23 '14 at 11:39
  • provide some examples of these lines – blotto Jun 24 '14 at 15:55

1 Answers1

0

In order for an entry to be tagged as an Error in Logentries, you need to create an Alert under "Tags & Alerts". Here's one that I've created for Mysql2::Error:

Configuring an Alert
(source: infused.org)

Here's how it is configured (note that the label is set to "Error"):

Configuring an Alert2
(source: infused.org)

Read through the documentation for Tags & Alerts for more info.

Community
  • 1
  • 1
infused
  • 24,000
  • 13
  • 68
  • 78