Skip to Content
Mastering PHP 7
book

Mastering PHP 7

by Branko Ajzele
June 2017
Intermediate to advanced
536 pages
9h 49m
English
Packt Publishing
Content preview from Mastering PHP 7

Native logging

PHP has a built-in error_log() function that sends an error message to the defined error handling routines; thus, providing an out-of-the-box solution for simple logging.

The following code snippet describes the error_log() function definition:

    bool error_log (        string $message       [, int $message_type = 0         [, string $destination           [, string $extra_headers ] ]]     )

The parameters are defined as follows:

  • $message: This is a string type value, and a message we want to log
  • $message_type: This is an integer type value; it has one of four possible values, which are as follows:
    • 0: This is an operating system logging mechanism
    • 1: This is sent by e-mail to the address in the destination parameter 
    • 2: This is no longer an option
    • 3: This ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning PHP 7

Learning PHP 7

Antonio L Zapata (GBP)
Upgrading to PHP 5

Upgrading to PHP 5

Adam Trachtenberg

Publisher Resources

ISBN: 9781785882814Supplemental Content