note 124427 added to function.error-log
| From: | russ at russtanner dot com | Date: | Fri, 22 Nov 2019 21:10:28 +0000 |
| Subject: | note 124427 added to function.error-log | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-213167@lists.php.net to get a copy of this message | ||
You can easily filter messages sent to error_log() using "tail" and "grep" on
*nix systems. This makes monitoring debug messages easy to see during development.
Be sure to "tag" your error message with a unique string so you can filter it using
"grep":
In your code:
error_log("DevSys1 - FirstName: $FirstName - LastName: $Lastname");
On your command line:
tail -f /var/log/httpd/error_log | grep DevSys1
In this example, we pipe apache log output to grep (STDIN) which filters it for you only showing
messages that contain "DevSys1".
The "-f" option means "follow" which streams all new log entries to your
terminal or to any piped command that follows, in this case "grep".
----
Server IP: 208.43.231.9
Probable Submitter: 82.199.157.54 (proxied: 198.133.167.85)
----
Manual Page -- http://php.net/manual/en/function.error-log.php
Edit -- https://master.php.net/note/edit/124427
Del: integrated -- https://master.php.net/note/delete/124427/integrated
Del: useless -- https://master.php.net/note/delete/124427/useless
Del: bad code -- https://master.php.net/note/delete/124427/bad+code
Del: spam -- https://master.php.net/note/delete/124427/spam
Del: non-english -- https://master.php.net/note/delete/124427/non-english
Del: in docs -- https://master.php.net/note/delete/124427/in+docs
Del: other reasons-- https://master.php.net/note/delete/124427
Reject -- https://master.php.net/note/reject/124427
Search -- https://master.php.net/manage/user-notes.php