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

Suggestion: Better core logging #5278

Open
ValiDrv opened this issue Mar 21, 2024 · 0 comments
Open

Suggestion: Better core logging #5278

ValiDrv opened this issue Mar 21, 2024 · 0 comments

Comments

@ValiDrv
Copy link

ValiDrv commented Mar 21, 2024

Please answer these questions before submitting your issue.

  1. What did you do? If possible, provide a simple script for reproducing the error.

We have Swoole applications in docker running on multiple servers, sending logs to a central server via syslog.
We are having issues with grouping multiple core Swoole errors error lines in one line.

For example: if the function deadlock_check() would have a few spaces, it would make grouping and parsing those logs allot easier.
Current:

echo "\n===================================================================",
    "\n [FATAL ERROR]: all coroutines (count: {$count}) are asleep - deadlock!",
    "\n===================================================================\n";
...
echo "\n [Coroutine-{$cid}]";
echo "\n--------------------------------------------------------------------\n";
echo Coroutine::printBackTrace($cid, DEBUG_BACKTRACE_IGNORE_ARGS, $depth);
echo "\n";

Suggestion:

echo "\n===================================================================",
    "\n [FATAL ERROR]: all coroutines (count: {$count}) are asleep - deadlock!",
    "\n "; # << add a space
//    "\n ===================================================================\n"; 
...
echo "\n [Coroutine-{$cid}]";
echo "\n --------------------------------------------------------------------\n"; # << prefix with a space
echo Coroutine::printBackTrace($cid, DEBUG_BACKTRACE_IGNORE_ARGS, $depth); # << prefix with a spaces
echo "\n "; # << prefix with a space

And this should probably be the case for all logs that act as a unit, including Swoole crash logs and so on.

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

No branches or pull requests

2 participants