How do I log errors and warnings into a file?

前端 未结 7 1372
感动是毒
感动是毒 2020-11-22 04:43

How do I turn on all error and warnings and log them to a file, but to set up all of that within the script (not changing anything in php.ini)?

I want to define a fi

相关标签:
7条回答
  • 2020-11-22 05:12

    See

    • error_log — Send an error message somewhere

    Example

    error_log("You messed up!", 3, "/var/tmp/my-errors.log");
    

    You can customize error handling with your own error handlers to call this function for you whenever an error or warning or whatever you need to log occurs. For additional information, please refer to the Chapter Error Handling in the PHP Manual

    0 讨论(0)
提交回复
热议问题