note 123594 added to function.syslog
| From: | rgagnon24 at gmail dot com | Date: | Sat, 09 Feb 2019 04:39:22 +0000 |
| Subject: | note 123594 added to function.syslog | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-210205@lists.php.net to get a copy of this message | ||
This one had me going for a while when using LOG_ constants in another object, when developing on
Windows, but deploying on Linux.
Windows evaluates some of the LOG_ constants to the same value, while LINUX does not.
The 8 constants and their differences on the platforms to be aware of:
Linux has these values as:
========================
LOG_EMERG = 0
LOG_ALERT = 1
LOG_CRIT = 2
LOG_ERR = 3
LOG_WARNING = 4
LOG_NOTICE = 5
LOG_INFO = 6
LOG_DEBUG = 7
While on Windows, you have:
==========================
LOG_EMERG = 1
LOG_ALERT = 1
LOG_CRIT = 1
LOG_ERR = 4
LOG_WARNING = 5
LOG_NOTICE = 6
LOG_INFO = 6
LOG_DEBUG = 6
So if you're setting LOG_WARNING in your code, Linux will use 4 as the priority while Windows
will use 5.
This is not a bug in PHP on either platform, but a difference in the system header files that PHP
compiles with. Not really anything you can do, but be aware if you're wondering why your
messages log at different priorities depending on the platform, this could be why.
----
Server IP: 208.43.231.9
Probable Submitter: 82.199.157.35 (proxied: 8.37.102.39)
----
Manual Page -- http://php.net/manual/en/function.syslog.php
Edit -- https://master.php.net/note/edit/123594
Del: integrated -- https://master.php.net/note/delete/123594/integrated
Del: useless -- https://master.php.net/note/delete/123594/useless
Del: bad code -- https://master.php.net/note/delete/123594/bad+code
Del: spam -- https://master.php.net/note/delete/123594/spam
Del: non-english -- https://master.php.net/note/delete/123594/non-english
Del: in docs -- https://master.php.net/note/delete/123594/in+docs
Del: other reasons-- https://master.php.net/note/delete/123594
Reject -- https://master.php.net/note/reject/123594
Search -- https://master.php.net/manage/user-notes.php