Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Socket connection problems when using Roadrunner/Swoole (Octane) #141

Open
alexc-hollywood opened this issue Jan 6, 2023 · 0 comments
Open

Comments

@alexc-hollywood
Copy link

I've been using this with the Laravel wrapper (https://github.com/hedii/laravel-gelf-logger) for a long while and it's been working flawlessly. It's working as a bridge to send log data from Laravel directly to Seq (https://datalust.co/).

Example configuration in config/logging.php:

        'seq' => [
            'driver' => 'custom',
            'via' => \Hedii\LaravelGelfLogger\GelfLoggerFactory::class,
            'processors' => [\Hedii\LaravelGelfLogger\Processors\NullStringProcessor::class,],
            'level' => env('GELF_MIN_LEVEL', 'debug'),
            'name' => env('GELF_CHANNEL', 'acme'),
            'system_name' => env('GELF_SOURCE', 'laravel'),
            'transport' => env('GELF_TRANSPORT', 'tcp'),
            'host' => env('GELF_HOST', '127.0.0.1'),
            'port' => env('GELF_PORT', 12201),
            'path' => env('GELF_HTTP_PATH', null),
            'max_length' => null,
            'context_prefix' => null,
            'extra_prefix' => null,
        ],

On a single request/response cycle it works fine, however that changes when you switch it to an Octane-based container which holds the code in memory, such as https://github.com/Anteris-Dev/docker-laravel-roadrunner . When it's running with the log channel set to a text file, it works as expected.

But when you switch it to GELF-based logging (e.g. Seq), only the first log entries are created once the framework has been cached on its first run. Any subsequent log entries fail to appear. It's like the connection isn't implicitly closed once the message has been sent via its transport.

To reproduce:

  1. Create a POST endpoint which logs traffic and payload.
  2. Establish a baseline by sending 10 looped POST requests to it, using FPM and text-based logging.
  3. Switch to Seq logging and confirm the behaviour is identical (10 requests appearing in the event log).
  4. Change to Octane-based PHP and repeat with text-based logging. Confirm it is identical.
  5. Switch to Seq logging and watch in real time. Only the first POST will be logged.

Probably not a bug, but worth bringing up for the purposes of investigation. It's an excellent package and it would be great to combine it with the performance of Roadrunner and/or Swoole.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant