At first, I didn't internalize the substance of the log message, and assumed the logger was filtering out your statement due to the target's configured "levels."
However, considering that sleep()
is typically avoided in user-facing web requests, it occurred to me that we're looking at some code that is in a queue job or console command.
Craft maintains a discrete log file for each context:
- Web requests log to
storage/logs/web.log
;
- Queue jobs (not really a "request type" per se) log to
storage/logs/queue.log
;
- The CLI logs to
storage/logs/console.log
;
Some plugins or modules may create and log to other files, and via app.php
, log targets can be configured to ignore or otherwise filter and redirect log statements based on the environment.
For an in-depth look at Craft's logging system, check out Zen and the Art of Craft CMS Log File Reading on nystudio107.
ENVIRONMENT
set as, in.env
?web.log
, but for the queue (regardless of how it's running), it goes inqueue.log
, and (unsurprisingly) the CLI outputs toconsole.log
! Make sure you're looking in the correct file, and if the volume of data is too large to scan, you can runtail -f storage/logs/{file}.log | grep {your method or class name}
.