<p>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 &quot;levels.&quot;</p>
<p>However, considering that <code>sleep()</code> 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.</p>
<p>Craft maintains a discrete log file for each context:</p>
<ol>
<li>Web requests log to <code>storage/logs/web.log</code>;</li>
<li>Queue jobs (not really a &quot;request type&quot; per se) log to <code>storage/logs/queue.log</code>;</li>
<li>The CLI logs to <code>storage/logs/console.log</code>;</li>
</ol>
<p>Some plugins or modules may create and log to other files, and via <code>app.php</code>, log targets can be configured to ignore or otherwise filter and redirect log statements based on the environment.</p>
<p>For an in-depth look at Craft's logging system, check out <a href="https://nystudio107.com/blog/zen-and-the-art-of-craft-cms-log-file-reading" rel="nofollow noreferrer">Zen and the Art of Craft CMS Log File Reading</a> on nystudio107.</p>

CC BY-SA 4.0
2021-12-16T23:18:44.973Z
2021-12-16T23:18:44.973Z
August Miller
<p>I am trying to log sone info on my plugins service work like below:</p>
<pre><code>Craft::info(
  Craft::t('mapitapi',
          'Sleeping for 1 secs ..saved funding entry: ' . $element-&gt;id . ':' . $element-&gt;title . '| lsoa:' . $element-&gt;lsoacode),
           __METHOD__
         );
</code></pre>
<p>But nothing appears in the logs. Do i need to include something in the namespace? Or??</p>

CC BY-SA 4.0
2021-12-16T22:57:39.367Z
Info + Debug logs may get filtered out based on the application's environment. What is your `ENVIRONMENT` set as, in `.env`?
August Miller
CC BY-SA 4.0
2021-12-16T23:00:21.677Z
thanks for reply - .env is set like 
 ENVIRONMENT=dev
joomkit
CC BY-SA 4.0
2021-12-16T23:04:32.223Z
Ok, checks out… hmm! You will have a few log files, depending on where this is running. In a front-end "web" request, it'll go to `web.log`, but for the queue (regardless of how it's running), it goes in `queue.log`, and (unsurprisingly) the CLI outputs to `console.log`! Make sure you're looking in the correct file, and if the volume of data is too large to scan, you can run `tail -f storage/logs/{file}.log | grep {your method or class name}`.
August Miller
CC BY-SA 4.0
2021-12-16T23:09:06.847Z
It was in the queue log! Doh! Thx 
joomkit
<plugin-development><logs>
Plugin logging not appearing
# Plugin logging not appearing

(Asked by: username_0 on 2021-12-16)

I am trying to log sone info on my plugins service work like below:
Craft::info(
  Craft::t('mapitapi',
          'Sleeping for 1 secs ..saved funding entry: ' . $element->id . ':' . $element->title . '| lsoa:' . $element->lsoacode),
           __METHOD__
         );

But nothing appears in the logs. Do i need to include something in the namespace? Or??

**Tags:** plugin-development, logs
> **Comments:**
> **username_1**: Info + Debug logs may get filtered out based on the application's environment. What is your `ENVIRONMENT` set as, in `.env`?  
> **username_0**: thanks for reply - .env is set like   ENVIRONMENT=dev  
> **username_1**: Ok, checks out… hmm! You will have a few log files, depending on where this is running. In a front-end "web" request, it'll go to `web.log`, but for the queue (regardless of how it's running), it goes in `queue.log`, and (unsurprisingly) the CLI outputs to `console.log`! Make sure you're looking in the correct file, and if the volume of data is too large to scan, you can run `tail -f storage/logs/{file}.log | grep {your method or class name}`.  
> **username_0**: It was in the queue log! Doh! Thx   

---

## 1 answers

### Answer by username_1 on 2021-12-16. Score: 2

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:

1. Web requests log to `storage/logs/web.log`;
2. Queue jobs (not really a "request type" per se) log to `storage/logs/queue.log`;
3. 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](https://nystudio107.com/blog/zen-and-the-art-of-craft-cms-log-file-reading) on nystudio107.


---

