File tree Expand file tree Collapse file tree
src/Stackify/Log/Transport Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33require '../vendor/autoload.php ' ;
44
55//$transport = null;
6- $ transport = new Stackify \Log \Transport \CurlTransport ('0Zw8Fj4Hr3Aa1Sf2Gw4Cb3Gk7Fp6Zn6Sc0Gw2Cr ' );
6+ $ transport = new Stackify \Log \Transport \ExecTransport ('0Zw8Fj4Hr3Aa1Sf2Gw4Cb3Gk7Fp6Zn6Sc0Gw2Cr ' , [ ' debug ' => 1 ] );
77$ logger = new Stackify \Log \Standalone \Logger ('test.com ' , 'myPC ' , $ transport );
88
99session_start ();
1010$ _SESSION ['user_id ' ] = 42 ;
1111
1212try {
13- include 'exception.php ' ;
13+ // include 'exception.php';
1414} catch (Exception $ ex ) {
1515 $ logger ->warning ('test ' , ['exception ' => $ ex , 'a ' => 'b ' ]);
1616}
1717
18- $ logger ->info ('mess \' age ' );
19- $ logger ->alert ('test ' );
18+ $ logger ->info ('message ' );
19+ // $logger->alert('test');
Original file line number Diff line number Diff line change 33namespace Stackify \Log \Transport ;
44
55use Stackify \Log \Transport \Config \Api ;
6- use Stackify \Exceptions \InitializationException ;
76
87/**
98 * This transport collects log data until the end of processing.
@@ -20,9 +19,7 @@ class ExecTransport extends AbstractApiTransport
2019 public function __construct ($ apiKey , array $ options = array ())
2120 {
2221 parent ::__construct ($ apiKey , $ options );
23- if ('Windows ' === substr (php_uname (), 0 , 7 )) {
24- throw new InitializationException ('CurlTransport does not work on Windows ' );
25- }
22+ // @TODO windows support
2623 }
2724
2825 protected function getAllowedOptions ()
@@ -39,9 +36,7 @@ protected function getTransportName()
3936
4037 protected function send ($ data )
4138 {
42- echo $ data ;
43- // @TODO
44- $ url = Api::API_BASE_URL ;
39+ $ url = Api::API_BASE_URL . Api::API_CALL_LOGS ;
4540 $ cmd = "$ this ->curlPath -X POST " ;
4641 foreach ($ this ->getApiHeaders () as $ name => $ value ) {
4742 $ cmd .= " --header \"$ name: $ value \"" ;
You can’t perform that action at this time.
0 commit comments