Skip to content

Commit bc775d2

Browse files
committed
Update README.md
1 parent aef2493 commit bc775d2

1 file changed

Lines changed: 35 additions & 32 deletions

File tree

README.md

Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,26 @@ There are three different transport options that can be configured to send data
1919

2020
###ExecTransport:
2121
ExecTransport does not require a Stackify agent to be installed because it sends data directly to Stackify services. It collects log entries in a single batch, calls curl using the ```exec``` function, and sends it to the background immediately [```exec('curl ... &')```]. This will affect the performance of your application minimally, but it requires permissions to call ```exec``` inside the PHP script and it may cause silent data loss in the event of any network issues. This transport method does not work on Windows. To configure ExecTransport you need to pass the environment name and API key (license key):
22-
```php
23-
use Stackify\Log\Transport\ExecTransport;
24-
use Stackify\Log\Monolog\Handler as StackifyHandler;
22+
23+
```php
24+
use Stackify\Log\Transport\ExecTransport;
25+
use Stackify\Log\Monolog\Handler as StackifyHandler;
26+
27+
$transport = new ExecTransport('api_key');
28+
$handler = new StackifyHandler('application_name', 'environment_name', $transport);
29+
```
30+
31+
```yml
32+
# or configuration file example
33+
services:
34+
stackify_transport:
35+
class: "Stackify\\Log\\Transport\ExecTransport"
36+
arguments: ["api_key"]
37+
stackify_handler:
38+
class: "Stackify\\Log\\Monolog\\Handler"
39+
arguments: ["application_name", "environment_name", "@stackify_transport"]
40+
```
2541
26-
$transport = new ExecTransport('api_key');
27-
$handler = new StackifyHandler('application_name', 'environment_name', $transport);
28-
```
29-
```yml
30-
# or configuration file example
31-
services:
32-
stackify_transport:
33-
class: "Stackify\\Log\\Transport\ExecTransport"
34-
arguments: ["api_key"]
35-
stackify_handler:
36-
class: "Stackify\\Log\\Monolog\\Handler"
37-
arguments: ["application_name", "environment_name", "@stackify_transport"]
38-
```
3942
####Configuration:
4043
<b>Proxy</b>
4144
- ExecTransport and CurlTransport support data delivery through proxy. Specify proxy using [libcurl format](http://curl.haxx.se/libcurl/c/CURLOPT_PROXY.html): <[protocol://][user:password@]proxyhost[:port]>
@@ -50,23 +53,23 @@ $transport = new ExecTransport($apiKey, ['curlPath' => '/usr/bin/curl']);
5053
```
5154
###CurlTransport
5255
CurlTransport does not require a Stackify agent to be installed and it also sends data directly to Stackify services. It collects log entries in a single batch and sends data using native [PHP cURL](http://php.net/manual/en/book.curl.php) functions. This way is a blocking one, so it should not be used on production environments. To configure CurlTransport you need to pass environment name and API key (license key):
53-
```php
54-
use Stackify\Log\Transport\CurlTransport;
55-
use Stackify\Log\Monolog\Handler as StackifyHandler;
56+
```php
57+
use Stackify\Log\Transport\CurlTransport;
58+
use Stackify\Log\Monolog\Handler as StackifyHandler;
5659
57-
$transport = new CurlTransport('api_key');
58-
$handler = new StackifyHandler('application_name', 'environment_name', $transport);
59-
```
60-
```yml
61-
# or configuration file example
62-
services:
63-
stackify_transport:
64-
class: "Stackify\\Log\\Transport\CurlTransport"
65-
arguments: ["api_key"]
66-
stackify_handler:
67-
class: "Stackify\\Log\\Monolog\\Handler"
68-
arguments: ["application_name", "environment_name", "@stackify_transport"]
69-
```
60+
$transport = new CurlTransport('api_key');
61+
$handler = new StackifyHandler('application_name', 'environment_name', $transport);
62+
```
63+
```yml
64+
# or configuration file example
65+
services:
66+
stackify_transport:
67+
class: "Stackify\\Log\\Transport\CurlTransport"
68+
arguments: ["api_key"]
69+
stackify_handler:
70+
class: "Stackify\\Log\\Monolog\\Handler"
71+
arguments: ["application_name", "environment_name", "@stackify_transport"]
72+
```
7073
####Configuration:
7174
<b>Proxy</b>
7275
- ExecTransport and CurlTransport support data delivery through proxy. Specify proxy using [libcurl format](http://curl.haxx.se/libcurl/c/CURLOPT_PROXY.html): <[protocol://][user:password@]proxyhost[:port]>

0 commit comments

Comments
 (0)