Closed sauravkumal closed 3 years ago
I just had the same problem: The logs contain two extra square brackets at the end. So the original log message "The system is down!" is formatted to "The system is down! [] []".
The 4th parameter$ignoreEmptyContextAndExtra of LineFormatter constructor hides empty arrays from formatted output. Also see: https://stackoverflow.com/a/13971250/13448160
I can create a pull request for it if you want :) Why did you add a "help wanted" tag?
I have fixed as you suggested. If someone want to make PR with flexible values (move the line formatter options to config) it would be great.
https://github.com/GrKamil/laravel-telegram-logging/blob/f746dbb2413afdaac7faa9465000e50b33a6b8e3/src/TelegramHandler.php#L98
possible quick solution:
return new LineFormatter("%message% %context% %extra%\n",null, false, true);
Or can add them to config for flexibility