You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When logging with single-quoted' strings that containing escape characters like \r and [ ], they are being interpreted in the log output. This results in unexpected behavior, such as \r being converted to a carriage return, even though single-quoted strings in PHP treat backslashes as literal characters.
Using Illuminate\Support\Facades\Log
With default logging configuration.
2- In any route, controller, or model file, log a string using single-quotes with a backslash \r and bracket [ ].
Example: Log::info('[MyNamespace\routes\non-web\application]');
As Laravel is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub.
If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed by the Laravel team.
Laravel Version
11.30.0
PHP Version
8.3.13 64bit TS
Database Driver & Version
No response
Description
When logging with single-quoted
'
strings that containing escape characters like\r
and[ ]
, they are being interpreted in the log output. This results in unexpected behavior, such as\r
being converted to a carriage return, even though single-quoted strings in PHP treat backslashes as literal characters.Using Illuminate\Support\Facades\Log
With default logging configuration.
Steps To Reproduce
1- Download and create a Laravel 11 application project. (https://laravel.com/docs/11.x)
2- In any route, controller, or model file, log a string using single-quotes with a backslash
\r
and bracket[ ]
.Example:
Log::info('[MyNamespace\routes\non-web\application]');
3- Check the Laravel log file.
Expected output
Actual output
The text was updated successfully, but these errors were encountered: