Log structured backtrace for exceptions

Created on 7 October 2023, over 1 year ago

Problem/Motivation

Will be good to implement logging of a structured backtrace for any Exception, instead of just a message string.

Feature request
Status

Fixed

Version

1.0

Component

Code

Created by

🇦🇲Armenia murz Yerevan, Armenia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @murz
  • 🇦🇲Armenia murz Yerevan, Armenia
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 8
    last update over 1 year ago
    3 pass
  • @murz opened merge request.
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 8
    last update over 1 year ago
    3 pass
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 8
    last update over 1 year ago
    3 pass
    • Murz committed 5b6b1eec on 1.0.x
      Issue #3392318: Log structured backtrace for exceptions
      
  • 🇦🇲Armenia murz Yerevan, Armenia

    Implemented, now exceptions and other throwable objects will be represented like this:

    {
      "time": "2023-09-25T08:44:09+04:30",
      "message": "Exception: MyError in Drupal\\my_module\\Form\\MyForm->buildForm() (line 69 of /var/www/html/docroot/modules/custom/my_module/src/Form/MyForm.php).",
      "channel": "php",
      "request_uri": "https://my.ddev.site/admin/config/my-module",
      "level": "error",
      "uid": "1",
      "exception": {
        "message": "MyError",
        "code": 0,
        "file": "/var/www/html/docroot/modules/custom/my_module/src/Form/MyForm.php",
        "line": 69,
        "trace": [
          {
            "function": "buildForm",
            "class": "Drupal\\my_form\\my_module\\Form\\MyForm->buildForm",
            "type": "->",
            "args": [
              {
                "#attributes": {
                  "class": [
                    "my-form"
                  ]
                }
              },
              {}
            ]
          },
          {
            "file": "/var/www/html/docroot/core/lib/Drupal/Core/Form/FormBuilder.php",
            "line": 536,
            "function": "call_user_func_array",
            "args": [
              [
                {},
                "buildForm"
              ],
              [
                {
                  "#attributes": {
                    "class": [
                      "my-form"
                    ]
                  }
                },
                {}
              ]
            ]
          },
          ...
  • Status changed to Fixed over 1 year ago
  • 🇦🇲Armenia murz Yerevan, Armenia
Production build 0.71.5 2024