Answers.Body: <p>That's <a href="http://buildwithcraft.com/docs/config-settings#devMode" rel="nofollow">devMode</a> output (usually gets sent to your browser's console).</p>
  
  <p>If you want to run your plugin in devMode, add this to your plugin's <code>init()</code> method:</p>
  
  <pre><code>craft()-&gt;log-&gt;removeRoute('WebLogRoute');
  craft()-&gt;log-&gt;removeRoute('ProfileLogRoute');
  </code></pre>
  
  <p>And it will get rid of the extra output.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-10-04T21:48:48.517Z
Answers.Text: To get rid of this without the init() changes can i change the devMode to false for this environment?
Answers.UserDisplayName: mbalparda
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-10-04T22:59:49.340Z
Answers.Text: That'll work, too.
Answers.UserDisplayName: Brad Bell
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-10-03T21:17:29.620Z
Answers.LastActivityDate: 2014-10-03T21:17:29.620Z
Answers.UserDisplayName: Brad Bell
Body: <p>I created a cron for an import and i pointed it to a Craft controller. Everything is working as expected but im getting a strange output after the die() call. It is something starting with </p>
  
  <pre><code>Import finished&lt;script type="text/javascript"&gt;
  
  /*&lt;![CDATA[*/
  if (typeof(console) == 'object')
  {
          console.groupCollapsed("Application Log");
  
                  console.groupCollapsed("GET info");
          console.log("[20:51:21.230][info][application]\n");
          console.groupEnd();
          console.groupCollapsed("Info om informasjonskapsel");
          console.log("[20:51:21.230][info][application]\n$_GET=array (\n  \'p\' =&gt; \'actions/garp/cron/changeStock\',\n)\n\n");
          console.groupEnd();
          console.groupCollapsed("SERVER info");
          console.log("[20:51:21.230][info][application]\n$_SERVER=array (\n  \'REDIRECT_HTTPS\' =&gt; \'on\',\n  \'REDIRECT_SSL_TLS_SNI\' =&gt; \'staging.alfa.rrdev.co\',\n  \'REDIRECT_STATUS\' =&gt; \'200\',\n  \'HTTPS\' =&gt; \'on\',\n  \'SSL_TLS_SNI\' =&gt; \'staging.alfa.rrdev.co\',\n  \'HTTP_USER_AGENT\' =&gt; \'Wget/1.15 (linux-gnu)\',\n  \'HTTP_ACCEPT\' =&gt; \'*/*\',\n  \'HTTP_HOST\' =&gt; \'staging.alfa.rrdev.co\',\n  \'HTTP_CONNECTION\' =&gt; \'Keep-Alive\',\n  \'PATH\' =&gt; \'/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\',\n  \'SERVER_SIGNATURE\' =&gt; \'&lt;address&gt;Apache/2.4.7 (Ubuntu) Server at staging.alfa.rrdev.co Port 443&lt;\/address&gt;\n\',\n  \'SERVER_SOFTWARE\' =&gt; \'Apache/2.4.7 (Ubuntu)\',\n  \'SERVER_NAME\' =&gt; \'staging.alfa.rrdev.co\',\n  \'SERVER_ADDR\' =&gt; \'172.31.34.161\',\n  \'SERVER_PORT\' =&gt; \'443\',\n  \'REMOTE_ADDR\' =&gt; \'54.76.237.6\',\n  \'DOCUMENT_ROOT\' =&gt; \'/var/www/alfa/public\',\n  \'REQUEST_SCHEME\' =&gt; \'https\',\n  \'CONTEXT_PREFIX\' =&gt; \'\',\n  \'CONTEXT_DOCUMENT_ROOT\' =&gt; \'/var/www/alfa/public\',\n  \'SERVER_ADMIN\' =&gt; \'[no address given]\',\n  \'SCRIPT_FILENAME\' =&gt; \'/var/www/alfa/public/index.php\',\n  \'REMOTE_PORT\' =&gt; \'51921\',\n  \'REDIRECT_QUERY_STRING\' =&gt; \'p=actions/garp/cron/changeStock\',\n  \'REDIRECT_URL\' =&gt; \'/actions/garp/cron/changeStock\',\n  \'GATEWAY_INTERFACE\' =&gt; \'CGI/1.1\',\n  \'SERVER_PROTOCOL\' =&gt; \'HTTP/1.1\',\n  \'REQUEST_METHOD\' =&gt; \'GET\',\n  \'QUERY_STRING\' =&gt; \'p=actions/garp/cron/changeStock\',\n  \'REQUEST_URI\' =&gt; \'/actions/garp/cron/changeStock\',\n  \'SCRIPT_NAME\' =&gt; \'/index.php\',\n  \'PHP_SELF\' =&gt; \'/index.php\',\n  \'REQUEST_TIME_FLOAT\' =&gt; 1412369481.227,\n  \'REQUEST_TIME\' =&gt; 1412369481,\n)");
          console.groupEnd();
  </code></pre>
  
  <p>Code (actionChangeStock) ends with </p>
  
  <pre><code>    if (craft()-&gt;httpSession-&gt;get('garpfailed')) {
          echo "Import failed";
      } else {
          echo "Import finished";
      }
      die();
  }
  </code></pre>
  
  <p>and cron call is </p>
  
  <pre><code>wget -O /home/ubuntu/cronStock https://domain.com/actions/garp/cron/changeStock
  </code></pre>
  
  <p>Is this expected? Im getting a 9mb file when i should get only Import failed or Import finished.</p>
  
Tags: <plugin-development>
Title: Data after die()
ThreadText: # Data after die()
  
  (Asked by: username_0 on 2014-10-03)
  
  I created a cron for an import and i pointed it to a Craft controller. Everything is working as expected but im getting a strange output after the die() call. It is something starting with
  
  ```
  Import finished<script type="text/javascript">
  
  /*<![CDATA[*/
  if (typeof(console) == 'object')
  {
          console.groupCollapsed("Application Log");
  
                  console.groupCollapsed("GET info");
          console.log("[20:51:21.230][info][application]\n");
          console.groupEnd();
          console.groupCollapsed("Info om informasjonskapsel");
          console.log("[20:51:21.230][info][application]\n$_GET=array (\n  \'p\' => \'actions/garp/cron/changeStock\',\n)\n\n");
          console.groupEnd();
          console.groupCollapsed("SERVER info");
          console.log("[20:51:21.230][info][application]\n$_SERVER=array (\n  \'REDIRECT_HTTPS\' => \'on\',\n  \'REDIRECT_SSL_TLS_SNI\' => \'staging.alfa.rrdev.co\',\n  \'REDIRECT_STATUS\' => \'200\',\n  \'HTTPS\' => \'on\',\n  \'SSL_TLS_SNI\' => \'staging.alfa.rrdev.co\',\n  \'HTTP_USER_AGENT\' => \'Wget/1.15 (linux-gnu)\',\n  \'HTTP_ACCEPT\' => \'*/*\',\n  \'HTTP_HOST\' => \'staging.alfa.rrdev.co\',\n  \'HTTP_CONNECTION\' => \'Keep-Alive\',\n  \'PATH\' => \'/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\',\n  \'SERVER_SIGNATURE\' => \'<address>Apache/2.4.7 (Ubuntu) Server at staging.alfa.rrdev.co Port 443<\/address>\n\',\n  \'SERVER_SOFTWARE\' => \'Apache/2.4.7 (Ubuntu)\',\n  \'SERVER_NAME\' => \'staging.alfa.rrdev.co\',\n  \'SERVER_ADDR\' => \'172.31.34.161\',\n  \'SERVER_PORT\' => \'443\',\n  \'REMOTE_ADDR\' => \'54.76.237.6\',\n  \'DOCUMENT_ROOT\' => \'/var/www/alfa/public\',\n  \'REQUEST_SCHEME\' => \'https\',\n  \'CONTEXT_PREFIX\' => \'\',\n  \'CONTEXT_DOCUMENT_ROOT\' => \'/var/www/alfa/public\',\n  \'SERVER_ADMIN\' => \'[no address given]\',\n  \'SCRIPT_FILENAME\' => \'/var/www/alfa/public/index.php\',\n  \'REMOTE_PORT\' => \'51921\',\n  \'REDIRECT_QUERY_STRING\' => \'p=actions/garp/cron/changeStock\',\n  \'REDIRECT_URL\' => \'/actions/garp/cron/changeStock\',\n  \'GATEWAY_INTERFACE\' => \'CGI/1.1\',\n  \'SERVER_PROTOCOL\' => \'HTTP/1.1\',\n  \'REQUEST_METHOD\' => \'GET\',\n  \'QUERY_STRING\' => \'p=actions/garp/cron/changeStock\',\n  \'REQUEST_URI\' => \'/actions/garp/cron/changeStock\',\n  \'SCRIPT_NAME\' => \'/index.php\',\n  \'PHP_SELF\' => \'/index.php\',\n  \'REQUEST_TIME_FLOAT\' => 1412369481.227,\n  \'REQUEST_TIME\' => 1412369481,\n)");
          console.groupEnd();
  
  ```
  
  Code (actionChangeStock) ends with
  
  ```
      if (craft()->httpSession->get('garpfailed')) {
          echo "Import failed";
      } else {
          echo "Import finished";
      }
      die();
  }
  
  ```
  
  and cron call is
  
  ```
  wget -O /home/ubuntu/cronStock https://domain.com/actions/garp/cron/changeStock
  
  ```
  
  Is this expected? Im getting a 9mb file when i should get only Import failed or Import finished.
  
  **Tags:** plugin-development
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2014-10-03. Score: 2 | Accepted answer
  
  That's [devMode](http://buildwithcraft.com/docs/config-settings#devMode) output (usually gets sent to your browser's console).
  
  If you want to run your plugin in devMode, add this to your plugin's `init()` method:
  
  ```
  craft()->log->removeRoute('WebLogRoute');
  craft()->log->removeRoute('ProfileLogRoute');
  
  ```
  
  And it will get rid of the extra output.
  
  > **Comments:**
  > **username_0**: To get rid of this without the init() changes can i change the devMode to false for this environment?  
  > **username_1**: That'll work, too.  
  
  ---
  
  