job-runner / psr-log-adapter
Installs: 13 835
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 2
Requires
- php: ~8.2.0 || ~8.3.0 || ~8.4.0
- job-runner/job-runner: ^1.4
- psr/log: ^1.1 || ^2.0 || ^3.0
Requires (Dev)
- doctrine/coding-standard: ^12.0
- phpstan/phpstan: ^2.0.1
- phpunit/phpunit: ^11.4.3
This package is auto-updated.
Last update: 2024-12-25 08:06:06 UTC
README
This package provides a psr-log adapter for JobRunner.
Installation
composer require job-runner/psr-log-adapter
Usage
<?php declare(strict_types=1); use JobRunner\JobRunner\Job\CliJob; use JobRunner\JobRunner\Job\JobList; use JobRunner\JobRunner\CronJobRunner; use JobRunner\JobRunner\PsrLog\PsrLogEventListener; require 'vendor/autoload.php'; $myLogger = new \Psr\Log\NullLogger(); $jobList = new JobList(); $jobList->push(new CliJob('php ' . __DIR__ . '/tutu.php', '* * * * *')); CronJobRunner::create()->withEventListener(new PsrLogEventListener($myLogger));->run($jobList);