Git Product home page Git Product logo

Comments (12)

samsonasik avatar samsonasik commented on June 17, 2024 1

Oh, you need to define trace and request_data column config in configurations, so, should be:

'writers' => [
                [
                    'name' => 'db',
                    'options' => [
                        'db' => 'Zend\Db\Adapter\Adapter',
                        'table' => 'log',
                        'column' => [
                            'timestamp' => 'date',
                            'priority' => 'type',
                            'message' => 'event',
                            'extra' => [
                                'url' => 'url',
                                'file' => 'file',
                                'line' => 'line',
                                'error_type' => 'error_type',
                                'trace'        => 'trace',
                                'request_data' => 'request_data'

                            ],
                        ],
                    ],
                ],

from errorheromodule.

samsonasik avatar samsonasik commented on June 17, 2024 1

I updated documentation of configuration at readme to define trace and request_data columns in configuration under writer -> options -> column -> extra at 8708910 ,

Please try and verify that fixes the issue ;)

from errorheromodule.

samsonasik avatar samsonasik commented on June 17, 2024

trace should never be empty in both http and console environment, but request_data will be empty for console environment. Do you have a specific error - step to reproduce ?

from errorheromodule.

pierrejochem avatar pierrejochem commented on June 17, 2024

Just a simple one who should have a trace:

syntax error, unexpected end of file, expecting function (T_FUNCTION)

from errorheromodule.

pierrejochem avatar pierrejochem commented on June 17, 2024

My config:

// config/autoload/error-hero-module.local.php or config/autoload/expressive-error-hero-module.local.php
return [
    'log' => [
        'ErrorHeroModuleLogger' => [
            'writers' => [
                [
                    'name' => 'db',
                    'options' => [
                        'db' => 'Zend\Db\Adapter\Adapter',
                        'table' => 'log',
                        'column' => [
                            'timestamp' => 'date',
                            'priority' => 'type',
                            'message' => 'event',
                            'extra' => [
                                'url' => 'url',
                                'file' => 'file',
                                'line' => 'line',
                                'error_type' => 'error_type',
                            ],
                        ],
                    ],
                ],
            ],
        ],
    ],
    'error-hero-module' => [
        // it's for the enable/disable the logger functionality
        'enable' => true,
        // default to true, if set to true, then you can see sample:
        // 1. /error-preview page ( ErrorHeroModule\Controller\ErrorPreviewController )
        // 2. error-preview command (ErrorHeroModule\Controller\ErrorPreviewConsoleController) via
        //       php public/index.php error-preview
        //
        // for zf-expressive ^1.0, the disable error-preview page is by unregister 'error-preview' from this config under "routes",
        // for zf-expressive ^2.0, the disable error-preview page is by unregister 'error-preview' from config/routes
        //
        //
        // otherwise(false), you can't see them, eg: on production env.
        'enable-error-preview-page' => true,
        'display-settings' => [
            // excluded php errors ( http://www.php.net/manual/en/errorfunc.constants.php )
            'exclude-php-errors' => [
                \E_USER_DEPRECATED,
            ],
            // excluded exceptions
            'exclude-exceptions' => [
                \App\Exception\MyException::class, // can be an Exception class or class extends Exception class
            ],
            // show or not error
            'display_errors' => 0,
            // if enable and display_errors = 0, the page will bring layout and view
            'template' => [
                'layout' => 'layout/layout',
                'view' => 'error/default'
            ],
            // if enable and display_errors = 0, the console will bring message
            'console' => [
                'message' => 'We have encountered a problem and we can not fulfill your request. An error report has been generated and sent to the support team and someone will attend to this problem urgently. Please try again later. Thank you for your patience.',
            ],
            // if enable, display_errors = 0, and request XMLHttpRequest
            // on this case, the "template" key will be ignored.
            'ajax' => [
                'message' => <<<json
{
    "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html",
    "title": "Internal Server Error",
    "status": 500,
    "detail": "We have encountered a problem and we can not fulfill your request. An error report has been generated and sent to the support team and someone will attend to this problem urgently. Please try again later. Thank you for your patience."
}
json
            ],
        ],
        'logging-settings' => [
            // time range for same error, file, line, url, message to be re-logged
            // in seconds range, 86400 means 1 day
            #'same-error-log-time-range' => 86400,
            'same-error-log-time-range' => 0,
        ],
        'email-notification-settings' => [
            // set to true to activate email notification on log error event
            'enable' => true,
            // Zend\Mail\Message instance registered at service manager
            'mail-message' => 'MailMessageService',
            // Zend\Mail\Transport\TransportInterface instance registered at service manager
            'mail-transport' => 'MailTransportService',
            // email sender
            'email-from' => 'Tester <[email protected]>',
            'email-to-send' => [
                '[email protected]'
            ],
        ],
    ],
        // ...
];

from errorheromodule.

samsonasik avatar samsonasik commented on June 17, 2024

Where the syntax error happen? in controller ? in view ? any specific sample code ?

from errorheromodule.

pierrejochem avatar pierrejochem commented on June 17, 2024

In that case it is a view helper from me, but just to produce an error

from errorheromodule.

samsonasik avatar samsonasik commented on June 17, 2024

I'm not sure I can help if there is no specific code to reproduce, you can try run command:

php public/index.php error-preview

or open http://yourzfapp/error-preview and you should get the trace value in db.

from errorheromodule.

pierrejochem avatar pierrejochem commented on June 17, 2024

After adding this to my bjyauthorize config:

['controller' => 'ErrorHeroModule\Controller\ErrorPreviewController', 'action' => 'exception', 'roles' => ['Guest']],

Sorry my fault :-(

I get this in my web app, when I call 'error-preview':

error

from errorheromodule.

pierrejochem avatar pierrejochem commented on June 17, 2024

Console output is:

+------------------------------------------------------------------------------------------------------------------------------------------------------+ |We have encountered a problem and we can not fulfill your request. An error report has been generated and sent to the support team and someone will | |attend to this problem urgently. Please try again later. Thank you for your patience. | +------------------------------------------------------------------------------------------------------------------------------------------------------+

from errorheromodule.

pierrejochem avatar pierrejochem commented on June 17, 2024

But still no trace in db. By the way I get it in the email notification. It is only missing in the database column.

from errorheromodule.

pierrejochem avatar pierrejochem commented on June 17, 2024

Yesssss, it works now :-) Thank you very much and perfect that you adapted it :-)

Very good work 👍

from errorheromodule.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.