Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-12-16T23:18:44.973Z
Answers.LastActivityDate: 2021-12-16T23:18:44.973Z
Answers.UserDisplayName: August Miller
Body: <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>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-12-16T22:57:39.367Z
Comments.Text: Info + Debug logs may get filtered out based on the application's environment. What is your `ENVIRONMENT` set as, in `.env`?
Comments.UserDisplayName: August Miller
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-12-16T23:00:21.677Z
Comments.Text: thanks for reply - .env is set like 
   ENVIRONMENT=dev
Comments.UserDisplayName: joomkit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-12-16T23:04:32.223Z
Comments.Text: 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}`.
Comments.UserDisplayName: August Miller
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-12-16T23:09:06.847Z
Comments.Text: It was in the queue log! Doh! Thx 
Comments.UserDisplayName: joomkit
Tags: <plugin-development><logs>
Title: Plugin logging not appearing
ThreadText: # 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.
  
  
  ---
  
  