Skip to content

Commit c8fde7e

Browse files
committed
Docs.
1 parent a54d6ea commit c8fde7e

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

docs/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,26 @@ echo number_format($progress * 100, 0) . '%'; // Outputs 87% for example
143143
```
144144

145145

146+
### Logging
147+
By default errors are always logged, and with log enabled also the execution of a job.
148+
Make sure you add this to your config:
149+
```php
150+
'Log' => [
151+
...
152+
'queue' => [
153+
'className' => ...,
154+
'type' => 'queue',
155+
'levels' => ['info'],
156+
'scopes' => ['queue'],
157+
],
158+
],
159+
```
160+
161+
When debugging (using -v) on the runworker, it will also log the worker run and end.
162+
163+
You can disable info logging by setting `Queue.log` to `false` in your config.
164+
165+
146166
### Notes
147167
`<TaskName>` may either be the complete classname (eg. QueueExample) or the shorthand without the leading "Queue" (e.g. Example).
148168

src/Shell/QueueShell.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ public function runworker() {
211211
* @return void
212212
*/
213213
protected function _logError($message) {
214-
Log::write('error', $message, ['scope' => 'queue']);
214+
Log::write('error', $message);
215215
}
216216

217217
/**

src/Shell/Task/QueueEmailTask.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public function run(array $data, $id) {
9696

9797
$error = $e->getMessage();
9898
$error .= ' (line ' . $e->getLine() . ' in ' . $e->getFile() . ')' . PHP_EOL . $e->getTraceAsString();
99-
Log::write('email_error', $error);
99+
Log::write('error', $error);
100100

101101
return false;
102102
}

0 commit comments

Comments
 (0)