Skip to content

Commit aa419c0

Browse files
committed
Update README.md
1 parent e27c1ef commit aa419c0

1 file changed

Lines changed: 12 additions & 24 deletions

File tree

README.md

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,12 @@ ExecTransport does not require a Stackify agent to be installed because it sends
2020

2121
```php
2222
use Stackify\Log\Transport\ExecTransport;
23-
use Stackify\Log\Monolog\Handler as StackifyHandler;
23+
use Stackify\Log\Standalone\Logger;
2424

2525
$transport = new ExecTransport('api_key');
2626
$handler = new StackifyHandler('application_name', 'environment_name', $transport);
2727
```
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-
```
39-
28+
4029
####Configuration:
4130
<b>Proxy</b>
4231
- 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]>
@@ -53,21 +42,12 @@ $transport = new ExecTransport($apiKey, ['curlPath' => '/usr/bin/curl']);
5342
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):
5443
```php
5544
use Stackify\Log\Transport\CurlTransport;
56-
use Stackify\Log\Monolog\Handler as StackifyHandler;
45+
use Stackify\Log\Standalone\Logger;
5746

5847
$transport = new CurlTransport('api_key');
5948
$handler = new StackifyHandler('application_name', 'environment_name', $transport);
6049
```
61-
```yml
62-
# or configuration file example
63-
services:
64-
stackify_transport:
65-
class: "Stackify\\Log\\Transport\CurlTransport"
66-
arguments: ["api_key"]
67-
stackify_handler:
68-
class: "Stackify\\Log\\Monolog\\Handler"
69-
arguments: ["application_name", "environment_name", "@stackify_transport"]
70-
```
50+
7151
####Configuration:
7252
<b>Proxy</b>
7353
- 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]>
@@ -78,6 +58,14 @@ $transport = new CurlTransport($apiKey, ['proxy' => 'https://55.88.22.11:3128'])
7858
AgentTransport does not require additional configuration in your PHP code because all data is passed to the [Stackify agent](https://stackify.screenstepslive.com/s/3095/m/7787/l/119709-installation-for-linux). The agent must be installed on the same machine. Local TCP socket is used, so performance of your application is affected minimally.
7959
```php
8060
use Stackify\Log\Standalone\Logger;
61+
62+
$logger = new Logger('appname.com');
63+
$logger->warning('something happened');
64+
try {
65+
$db->connect();
66+
catch (DbException $ex) {
67+
$logger->error('DB is not available', ['ex' => $ex]);
68+
}
8169
```
8270
####Configuration:
8371
- You will need to enable the TCP listener by checking a checkbox in "Server Settings" in Stackify for your server on the Servers Page. You can also change the default behavior for all your servers by going to the [Log Collectors Page](http://docs.stackify.com/m/7787/l/302705-log-collectors).

0 commit comments

Comments
 (0)