Skip to content

Remove usage of non-existing MAX_LINE_LENGTH constant #5634

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

Merged
merged 3 commits into from
Aug 24, 2024

Conversation

orlandothoeny
Copy link
Contributor

@orlandothoeny orlandothoeny commented May 27, 2020

I've been trying to solve PHP-FPM access logs from being truncated after 1023 characters. Getting the message NOTICE: the log buffer is full (1024). The access log request has been truncated. It works fine for error_logs by setting the log_limit configuration directive. Also tried log_errors_max_len. But access logs always get truncated after 1023 chars.

I have found this MAX_LINE_LENGTH constant in the file where the log message is generated. Thought it be set by some configuration. But I couldn't find any file where this constant is set. Not in the code, also not after compiling the source.

Seems like it was in the https://github.com/php/php-src/blob/master/sapi/fpm/fpm/zlog.c file before, and deleted in this commit: 3e5afbf#diff-f8c1cfc7c2ca0db20a3a595ab6de0e43L20
zlog.c gets included by fpm_log.c, might have been forgotten to also delete the constant in fpm_log.c?

This constant was apparently deleted in 3e5afbf#diff-f8c1cfc7c2ca0db20a3a595ab6de0e43L20
Issue for commit: #2458

Possible I've missed something out, and it exists after all. Maybe someone who actually has a clue can have a look :)

For my original issue: Ended up building PHP from source and patching it, increasing the hardcoded value of MAX_LINE_LENGTH .

@nikic
Copy link
Member

nikic commented Jun 5, 2020

The change itself is of course right, but cc @bukka on the motivating problem. Should log_limit apply to the access log as well?

@orlandothoeny
Copy link
Contributor Author

orlandothoeny commented Jun 5, 2020

If not, it would be nice if it would be configurable in some way. Didn't contribute to the PHP src yet. Would that need an RFC?

@bukka
Copy link
Member

bukka commented Jun 9, 2020

The change is correct but unfortunately it doesn't resolve the issue. It stays 1024...

It would be nice to use log_limit here but it would probably need to make use of zlog for that to work or do some other refactoring...

@bukka bukka added the SAPI: fpm label Jun 9, 2020
@juanpalaciosascend
Copy link

Hi everyone!

Has there any progress been made on this? This issue is also affecting logging for my application (also containerized, centralized logging, formatted to JSON, etc.), and no amount of logging configuration I put into my php-fpm config files make it go away.

Thanks in advance!

@orlandothoeny orlandothoeny requested a review from bukka as a code owner October 7, 2023 13:51
@piotrekkr
Copy link

Hit this issue recently myself. Was not aware that log limit setting does not work with access log. Would be great if it would.

@orlandothoeny
Copy link
Contributor Author

Fixed the styling mentioned in the review.

As mentioned by @nikic and @bukka, the PR does not fix the motivating problem and is more of cosmetic nature.

I think it would make sense to address making the log limit configurable in a new, separate issue.

@bukka bukka merged commit 9c26777 into php:master Aug 24, 2024
8 of 9 checks passed
@bukka
Copy link
Member

bukka commented Aug 24, 2024

@orlandothoeny there's #12302

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

Successfully merging this pull request may close these issues.

6 participants