Cli processor allows to log console command in Monolog.
Add library to your Composer project:
composer require ivol/monolog-cli-processor
<php>
// Autoload here
use Monolog\Logger;
use ivol\Monolog\Processor\CliProcessor;
$handlers = []; // Add handlers
$logger = new Logger('Logger_Name', $handlers, [new CliProcessor()]);
</php>
After that all log records in cli mode will be updated with extra cli arg.
exec-wrapper is released under the MIT License.