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
+22-3
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,8 @@ Alternative to the original [ChromeLogger](https://craig.is/writing/chrome-logge
11
11
*[PSR-7](http://www.php-fig.org/psr/psr-7/) HTTP message abstraction for the models, and
12
12
*[PSR-15](https://www.php-fig.org/psr/psr-15/) compliant middleware for quick integration.
13
13
14
+
✨ An alternative to the ChromeLogger extension [is also available](http://github.com/kodus/server-log)
15
+
and is [highly recommended](#header-size-limit).
14
16
15
17
## Usage
16
18
@@ -22,6 +24,8 @@ $logger = new ChromeLogger();
22
24
$logger->notice("awesome sauce!");
23
25
```
24
26
27
+
Note that this will have a [header-size limit](#header-size-limit) by default.
28
+
25
29
Using a PSR-7 compliant `ResponseInterface` instance, such as in a middleware stack, you can populate
26
30
the Response as follows:
27
31
@@ -69,11 +73,26 @@ try {
69
73
Any PHP values injected via the context array will be serialized for client-side inspection - including complex
70
74
object graphs and explicit serialization of problematic types like `Exception` and `DateTime`.
71
75
76
+
77
+
<aname="header-size-limit"></a>
72
78
### Header Size Limit
73
79
74
-
Note that [Chrome has a 250KB header size limit](https://cs.chromium.org/chromium/src/net/http/http_stream_parser.h?q=ERR_RESPONSE_HEADERS_TOO_BIG&sq=package:chromium&dr=C&l=159),
75
-
which we have to respect - due to this fact, the beginning of the log may get truncated, if the header-size is above
76
-
a set limit, which by default is 240KB. You can change this limit using the `ChromeLogger::setLimit()` method.
80
+
[Chrome has a 250KB header size limit](https://cs.chromium.org/chromium/src/net/http/http_stream_parser.h?q=ERR_RESPONSE_HEADERS_TOO_BIG&sq=package:chromium&dr=C&l=159)
81
+
and many popular web-servers (including NGINX and Apache) also have a limit.
82
+
83
+
By default, the beginning of the log will be truncated to keep the header size under the limit.
84
+
85
+
You can change this limit using the `ChromeLogger::setLimit()` method - but a better approach is
86
+
to enable logging to local files, which will persist in a web-accessible folder for 60 seconds:
0 commit comments