Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

loggly example

  • Loading branch information...
commit 1ad06b79af59b62f355e3afe31fd30395b58583f 1 parent 69ec564
@develop7 develop7 authored
Showing with 30 additions and 0 deletions.
  1. +20 −0 php/Loggly.php
  2. +10 −0 php/workers/loggly/loggly.php
View
20 php/Loggly.php
@@ -0,0 +1,20 @@
+<?php
+include("../IronWorker.class.php");
+
+$name = "loggly-php";
+
+$iw = new IronWorker('config.ini');
+$iw->debug_enabled = true;
+
+$zipName = "code/$name.zip";
+
+$zipFile = IronWorker::zipDirectory(dirname(__FILE__) . "/workers/loggly", $zipName, true);
+
+$res = $iw->postCode('loggly.php', $zipName, $name);
+
+for ($i = 1; $i <= 50; $i++)
+{
+ $payload = array('api_key' => LOGGLY_KEY, 'i' => $i);
+
+ $iw->postTask($name, $payload);
+}
View
10 php/workers/loggly/loggly.php
@@ -0,0 +1,10 @@
+<?php
+$payload = getPayload();
+$key = $payload['api_key'];
+$i = $payload['i'];
+$url = "http://logs.loggly.com/inputs/$key";
+$ctx = stream_context_create(array(
+ 'method' => 'POST',
+ 'content' => "I am now logging to Loggly $i times."
+));
+file_get_contents($url, null, $ctx);
Please sign in to comment.
Something went wrong with that request. Please try again.