Answers.Body: <p>Put the force parameter to true</p>
  
  <pre><code>MyPlugin::log("Errors:\n\n" . print_r($fieldsData, true), LogLevel::Error, true);
  </code></pre>
  
  <p><a href="https://craftcms.stackexchange.com/questions/2895/custom-log-in-craft">Custom Log in Craft</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-11-28T08:28:08.527Z
Answers.LastActivityDate: 2018-11-28T08:28:08.527Z
Answers.UserDisplayName: Wasnu
Body: <p>I'm having this weird issue that both of my custom plugin logs are not working but all other third party ones including craft.log work fine. By 'not working' I mean the log file is generated, but empty.</p>
  
  <p>Another weird thing is the issue only happens on production environment. Tested on local environment and staging environment, they all work fine.</p>
  
  <p>I believe I got the code right?</p>
  
  <p><code>MyPlugin::log("Errors:\n\n" . print_r($fieldsData, true), LogLevel::Error);</code></p>
  
  <p>It's Craft 2 by the way.</p>
  
  <p>Anything ideas?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-11-28T06:30:24.447Z
Comments.Text: Weird... I'm assuming devMode is not enabled in production.  Is it locally and in staging?
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-12-03T04:32:49.813Z
Comments.Text: devMode is enabled locally, but disabled on staging and production. Weird, huh? Anyway, forcing log param did the trick.
Comments.UserDisplayName: Wei
Tags: <craft2><logs><logging>
Title: Custom plugin log not logging
ThreadText: # Custom plugin log not logging
  
  (Asked by: username_0 on 2018-11-28)
  
  I'm having this weird issue that both of my custom plugin logs are not working but all other third party ones including craft.log work fine. By 'not working' I mean the log file is generated, but empty.
  
  Another weird thing is the issue only happens on production environment. Tested on local environment and staging environment, they all work fine.
  
  I believe I got the code right?
  
  `MyPlugin::log("Errors:\n\n" . print_r($fieldsData, true), LogLevel::Error);`
  
  It's Craft 2 by the way.
  
  Anything ideas?
  
  **Tags:** craft2, logs, logging
  
  > **Comments:**
  > **username_1**: Weird... I'm assuming devMode is not enabled in production.  Is it locally and in staging?  
  > **username_0**: devMode is enabled locally, but disabled on staging and production. Weird, huh? Anyway, forcing log param did the trick.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2018-11-28. Score: 2 | Accepted answer
  
  Put the force parameter to true
  
  ```
  MyPlugin::log("Errors:\n\n" . print_r($fieldsData, true), LogLevel::Error, true);
  
  ```
  
  [Custom Log in Craft](https://craftcms.stackexchange.com/questions/2895/custom-log-in-craft)
  
  
  ---
  
  