concepts / log-json-schema / events / error-event

Log Event JSON Schema - event.error

Note: Our libraries capture errors and exceptions and log this event automatically.

The error event formally tracks errors in your application. Instead of errors being a blob of text in your logs, Timber parses them and classifies it as a single event proper event.

Example JSON Structure

This:

RuntimeError: Failed to decode header from JSON
  lib/json_web_token/jws.ex:96 (JsonWebToken.Jws.header_map/1)
  lib/json_web_token/jws.ex:82 (JsonWebToken.Jws.validate_alg_matched/2)
  lib/json_web_token/jws.ex:77 (JsonWebToken.Jws.verify/3)
  lib/json_web_token/jws.ex:89 (JsonWebToken.Jwt.verify/2)
  lib/odin_auth/bearer_user.ex (Odin.Auth.BearerUser.jwt_decode/1)

Gets structured into:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
{
"event": {
   "error": {
      "name":"RuntimeError",
      "message":"Failed to decode header from JSON",
      "backtrace": [
         {
            "line":96,
            "function": "JsonWebToken.Jws.header_map/1",
            "file": "lib/json_web_token/jws.ex",
            "app_name": "json_web_token"
         },
         {
            "line":82,
            "function": "JsonWebToken.Jws.validate_alg_matched/2",
            "file": "lib/json_web_token/jws.ex",
            "app_name": "json_web_token"
         },
         {
            "line":77,
            "function": "JsonWebToken.Jws.verify/3",
            "file": "lib/json_web_token/jws.ex",
            "app_name": "json_web_token"
         },
         {
            "line":89,
            "function": "JsonWebToken.Jwt.verify/2",
            "file": "lib/json_web_token/jwt.ex",
            "app_name": "json_web_token"
         },
         {
            "line":43,
            "function": "Odin.Auth.BearerUser.jwt_decode/1",
            "file": "lib/odin_auth/bearer_user.ex",
            "app_name": "odin_auth"
         },
         {
            "line": 34,
            "function": "Odin.Auth.BearerUser.decode/1",
            "file": "lib/odin_auth/bearer_user.ex",
            "app_name": "odin_auth"
         },
         {
            "line":26,
            "function":"Odin.ClientAPI.Plug.BearerUserAuth.call/2",
            "file":"lib/odin_client_api/plug/bearer_user_auth.ex",
            "app_name":"odin_client_api"
         },
         {
            "line":28,
            "function":"Odin.ClientAPI.Router.bearer_user_auth/2",
            "file":"web/router.ex",
            "app_name":"odin_client_api"
         }
      ]
   }
}

Field descriptions

NameTypeDescription
namestringThe class or module name of the exception. required, max-length: 255
messagestringThe message included with the exception. required, max-length: 10,000
backtracearrayAn array of backtrace objects (see below). required

Backtrace line

NameTypeDescription
filestringThe path of the file. required, max-length: 1000
functionstringThe message included with the exception. required, max-length: 255
linenumberAn array of backtrace objects (see below). required
app_namestringThe app name, if applicable. This is generally used for elixir umbrella apps. optional, max-length: 255

Using this data

Example queries:

  • Search: error.name:RuntimeError
  • Only this event: is:exception

See our doc on searching.

Questions?

Chat with us, just click the talk button in the bottom right of this page.

Chat with us
Sign Up

Log better and solve problems faster, today. Install in under a minute.

Sign Up