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
Copy file name to clipboardExpand all lines: README.md
+34-5Lines changed: 34 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,18 +37,28 @@ $logger = new Logger('application_name', 'environment_name', $transport);
37
37
38
38
#### Optional Settings
39
39
40
-
<b>Proxy</b>
40
+
41
+
**Proxy**
41
42
- ExecTransport supports data delivery through proxy. Specify proxy using [libcurl format](http://curl.haxx.se/libcurl/c/CURLOPT_PROXY.html): <[protocol://][user:password@]proxyhost[:port]>
42
43
```php
43
44
$transport = new ExecTransport($apiKey, ['proxy' => 'https://55.88.22.11:3128']);
44
45
```
45
46
46
-
<b>Curl path</b>
47
+
**Curl path**
47
48
- It can be useful to specify ```curl``` destination path for ExecTransport. This option is set to 'curl' by default.
48
49
```php
49
50
$transport = new ExecTransport($apiKey, ['curlPath' => '/usr/bin/curl']);
50
51
```
51
52
53
+
**Log Server Environment Variables**
54
+
- Server environment variables can be added to error log message metadata. **Note:** This will log all
55
+
system environment variables; do not enable if sensitive information such as passwords or keys are stored this way.
56
+
57
+
```php
58
+
$logger = new Logger('application_name', 'environment_name', $transport, true);
59
+
```
60
+
61
+
52
62
### CurlTransport
53
63
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):
54
64
```php
@@ -61,22 +71,41 @@ $logger = new Logger('application_name', 'environment_name', $transport);
61
71
62
72
#### Optional Settings
63
73
64
-
<b>Proxy</b>
74
+
**Proxy**
65
75
- CurlTransport supports data delivery through proxy. Specify proxy using [libcurl format](http://curl.haxx.se/libcurl/c/CURLOPT_PROXY.html): <[protocol://][user:password@]proxyhost[:port]>
66
76
```php
67
77
$transport = new CurlTransport($apiKey, ['proxy' => 'https://55.88.22.11:3128']);
68
78
```
79
+
80
+
**Log Server Environment Variables**
81
+
- Server environment variables can be added to error log message metadata. **Note:** This will log all
82
+
system environment variables; do not enable if sensitive information such as passwords or keys are stored this way.
83
+
84
+
```php
85
+
$logger = new Logger('application_name', 'environment_name', $transport, true);
86
+
```
87
+
69
88
### AgentTransport
70
89
71
90
AgentTransport does not require additional configuration in your PHP code because all data is passed to the [Stackify agent](http://support.stackify.com/hc/en-us/articles/205419575). The agent must be installed on the same machine. Local TCP socket on port 10515 is used, so performance of your application is affected minimally.
72
91
```php
73
92
use Stackify\Log\Standalone\Logger;
74
93
75
-
$logger = new Logger('appname.com');
94
+
$logger = new Logger('application_name', 'environment_name');
76
95
```
77
96
78
97
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://support.stackify.com/hc/en-us/articles/204719709) for more details.
79
98
99
+
#### Optional Settings
100
+
101
+
**Log Server Environment Variables**
102
+
- Server environment variables can be added to error log message metadata. **Note:** This will log all
103
+
system environment variables; do not enable if sensitive information such as passwords or keys are stored this way.
104
+
105
+
```php
106
+
$logger = new Logger('application_name', 'environment_name', null, true);
107
+
```
108
+
80
109
## Troubleshooting
81
110
82
111
If transport does not work, try looking into ```vendor\stackify\logger\src\Stackify\debug\log.log``` file (if it is available for writing). Errors are also written to global PHP [error_log](http://php.net/manual/en/errorfunc.configuration.php#ini.error-log).
0 commit comments