Skip to content

Missing FlareApp Reports with Nginx Unit Web Requests #32

@dennyweiss

Description

@dennyweiss

I noticed that my logs and exception messages weren't being reported to FlareApp during web requests, although scheduled and queued jobs were unaffected.

After some investigation, I discovered that register_shutdown_function() doesn't execute when using Nginx Unit as the application server.

To work around this issue, I called Flare::reset() in the AppServiceProvider::boot() method like this:

Code kopieren
App::terminating(function () {
    if (!App::runningInConsole() && !App::runningUnitTests()) {
        App::make(\Spatie\FlareClient\Flare::class)->reset();
    }
});

This solution worked well for us so far. However, when using Flare as the logging channel, the context of the log calls (or the correct Stack trace) gets lost and is replaced with AppServiceProvider (where Flare::reset() was called).

Image

Does anyone know how I can preserve the log context so it displays correctly?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions