Skip to content

Commit 52c9872

Browse files
committed
Update README.md
1 parent 73ea071 commit 52c9872

File tree

1 file changed

+31
-5
lines changed

1 file changed

+31
-5
lines changed

README.md

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,34 @@ $transport = new ExecTransport($apiKey, ['curlPath' => '/usr/bin/curl']);
4545

4646
### CurlTransport
4747

48-
TODO
48+
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):
49+
50+
```php
51+
use Stackify\Log\Transport\CurlTransport;
52+
use Stackify\Log\Monolog\Handler as StackifyHandler;
53+
54+
$transport = new CurlTransport('api_key');
55+
$handler = new StackifyHandler('application_name', 'environment_name', $transport);
56+
$logger = new Logger('logger');
57+
$logger->pushHandler($handler);
58+
```
59+
60+
or configuration
61+
62+
```yml
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+
monolog:
71+
handlers:
72+
stackify:
73+
type: service
74+
id: stackify_handler
75+
```
4976
5077
#### Optional Configuration
5178
@@ -64,23 +91,22 @@ use Monolog\Logger;
6491
use Stackify\Log\Monolog\Handler as StackifyHandler;
6592

6693
$handler = new StackifyHandler('application_name');
67-
$logger = new Logger('log_channel');
94+
$logger = new Logger('logger');
6895
$logger->pushHandler($handler);
6996
```
7097

7198
or configuration
7299

73100
```yml
74-
# or configuration file example
75101
services:
76102
stackify_handler:
77103
class: "Stackify\\Log\\Monolog\\Handler"
78104
arguments: ["application_name"]
79105
monolog:
80106
handlers:
81107
stackify:
82-
type: service
83-
id: stackify_handler
108+
type: service
109+
id: stackify_handler
84110
```
85111
86112
You will need to enable the TCP listener by checking the "PHP App Logs (Agent Log Collector)" in the server settings page in Stackify. See [Log Collectors Page](http://docs.stackify.com/m/7787/l/302705-log-collectors) for more details.

0 commit comments

Comments
 (0)