Getting Started with PHP Connector

The php connector is a simple stand-alone php file which you can “include_once(‘ul-error-handler.php’);” into a base php file.

  • If you do not have an account go sign up and get collecting
  • Start by downloading the php file from the use it page after logging in.
  • Unzip it and open it
    • From your profile page get the Submission Url, Access Key and Secret Key
    • In the ul-error-handler.php file update the UL_SUBMISSIONURL, UL_ACCESSKEY, UL_SECRETKEY with the values from your profile
  • Put this file in your website root directory
  • Add include_once(‘ul-error-handler.php’); to a php file (usually a config file for your site)
    • The file this is added to should be loaded for every page in your site
    • e.g. in wordpress the file to add this to would be the wp-config.php
  • Review the logging level set in UL_LEVEL
    • The default level is E_ALL & ~E_NOTICE & ~E_DEPRECATED, we recommend this not be changed unless you are excluding more logging levels
    • If using earlier than PHP 5.3 use E_ALL & ~E_NOTICE & ~E_STRICT
    • Including more logging levels can cause your site to run slow because it is logging a lot
    • Many plugins and themes log a lot of E_NOTICE and E_DEPRECATED messages which is why they are excluded
    • More info on the levels can be found at: http://php.net/manual/en/errorfunc.constants.php

RECOMMENDED INDEXES

  • Add a notification to the default Error index which a condition to notify once if matched within 5 minutes
  • Add a new notification index and type in the word “warning” with a condition to notify once if matched within 5 minutes

To Learn More About Indexes Visits These Posts

If you are rolling your own php website and you would like to send data to Unified Logging use the function ul_log_message and pass the message to log.

If you are using WordPress you have another option, check out the WordPress plugin.

Comments are closed.