• Stan Hu's avatar
    Add backtrace to production_json.log · 35e5d5cd
    Stan Hu authored
    Sample JSON:
    
    ```
    {
      "method": "GET",
      "path": "/admin",
      "format": "html",
      "controller": "Admin::DashboardController",
      "action": "index",
      "status": 500,
      "duration": 2584.11,
      "view": 0,
      "db": 9.21,
      "time": "2019-11-14T13:12:46.156Z",
      "params": [],
      "remote_ip": "127.0.0.1",
      "user_id": 1,
      "username": "root",
      "ua": "Mozilla/5.0",
      "queue_duration": 274.35,
      "correlation_id": "KjDVUhNvvV3",
      "cpu_s": 2.837645135999999,
      "exception": {
        "class": "NameError",
        "message": "undefined local variable or method `adsf'",
        "backtrace": [
          "app/controllers/admin/dashboard_controller.rb:11:in `index'",
          ...
        ]
      }
    }
    ```
    
    This change also drops the `error` field in favor of `exception.class`
    and `exception.message`.
    
    Closes https://gitlab.com/gitlab-org/gitlab/issues/36297
    35e5d5cd
lograge.rb 2.02 KB