@@ -4,11 +4,14 @@ title: Logging
44
55Two different things get called logging here, and they solve different problems.
66
7- One is your own output — the ` echo ` and ` var_dump() ` you scatter about — arriving
8- in your editor instead of the response body. The other is the debugger's own log,
9- which is what you reach for when the debugger itself is not behaving.
7+ One is what your request produces as it runs — the ` echo ` and ` var_dump() ` you
8+ scatter about, and the warnings PHP raises along the way — arriving in your editor
9+ instead of the response body. The other is the debugger's own log, which is what
10+ you reach for when the debugger itself is not behaving.
1011
11- ## Your script's output in the editor
12+ ## What your request produces
13+
14+ ### Your script's output
1215
1316Your editor can ask for a copy of everything the script writes to standard output.
1417` echo ` , ` print_r() ` , ` var_dump() ` , whatever a framework writes — all of it appears
@@ -46,6 +49,23 @@ in the PHP error log for it.
4649
4750:::
4851
52+ ### Errors, warnings and notices
53+
54+ Separately from that output, your editor can ask to be told about every diagnostic
55+ PHP raises — errors, warnings, notices and deprecations — as they occur. Each one
56+ arrives with its message, its file and its line, and the script keeps running.
57+
58+ This is the middle ground between the two extremes. Ignoring a warning means
59+ finding it later in a log, if at all; breaking on one, with an
60+ [ exception breakpoint] ( ./breakpoints.md#exception-breakpoints ) on ` Warning ` , stops
61+ you dead every time it fires. A notification just tells you, in order, alongside
62+ everything else the request did.
63+
64+ This is a separate editor setting from output capture, negotiated the same way and
65+ likewise off unless your editor asks for it. It is worth turning on and leaving
66+ on: a deprecation you would never have gone looking for is exactly the kind of
67+ thing that turns up in that panel.
68+
4969## The debugger's own log
5070
5171The debug log is for the times the debugger is the problem: the session never
0 commit comments