You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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);
use Stackify\Log\Monolog\Handler as StackifyHandler;
65
92
66
93
$handler = new StackifyHandler('application_name');
67
-
$logger = new Logger('log_channel');
94
+
$logger = new Logger('logger');
68
95
$logger->pushHandler($handler);
69
96
```
70
97
71
98
or configuration
72
99
73
100
```yml
74
-
# or configuration file example
75
101
services:
76
102
stackify_handler:
77
103
class: "Stackify\\Log\\Monolog\\Handler"
78
104
arguments: ["application_name"]
79
105
monolog:
80
106
handlers:
81
107
stackify:
82
-
type: service
83
-
id: stackify_handler
108
+
type: service
109
+
id: stackify_handler
84
110
```
85
111
86
112
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