php-resque (pronounced like "rescue") is a Redis-backed library for creating background jobs, placing those jobs on multiple queues, and processing them later.
← Go back to main documentation
php-resque uses Monolog for logging which comes will built-in support for logging into different files, databases, and software.
There is inbuilt support for many of the Monolog drivers which makes it very easy to start logging straight from the command line when starting the worker.
The following logging drivers are supported:
console
- Outputs everything to the command lineoff
- Doesn't output anythingstream:path/to/output.log
- Appends to a filepath/to/output.log
- Appends to a fileerrorlog:0
- Sends to php error_logrotate:5:path/to/output.log
- Saves to file and rotates filesredis://127.0.0.1:6379/log
- Saves to Redismongodb://127.0.0.1:27017/dbname/log
- Saves to MongoDBcouchdb://127.0.0.1:27017/dbname
- Saves to CouchDBamqp://127.0.0.1:5763/name
- Sends to AMQP serversocket:udp://127.0.0.1:80
- Sends data to a socketsyslog:myfacility/local6
- Sends data to syslogcube:udp://localhost:5000
- Sends data to Cube
The following parameters can be used and are replaced at runtime so it's easy to separate logs from different workers and hosts:
%host%
- Hostname%worker%
- Worker ID%pid%
- Worker process ID%date%
- Current date (Y-m-d)%time%
- Current time (H:i)
An example of logging to Redis separated by a worker, and to the terminal, might be:
$ vendor/bin/resque worker:start --log=redis://127.0.0.1:6379/%worker%:log --log=console