Logging is here!

PHP

Crawler Crawler
PHP Graph

Overview

Connect your PHP applications to Datadog to:

  • Visualize their performance
  • Correlate their performance with the rest of your applications
  • Monitor any relevant metric
  • Collect your PHP logs

Setup

Installation

The PHP integration enables you to monitor any custom metric by instrumenting a few lines of code. For instance, you can have a metric that returns the number of page views or the time of any function call. For additional information about the PHP integration, please refer to this guide on submitting metrics. For advanced usage, please refer to the documentation in the repository.

  1. Install the library by cloning the Git repository:

    git clone git@github.com:DataDog/php-datadogstatsd.git
    
  2. Start instrumenting your code:

    # Require the datadogstatsd.php library file
    require './libraries/datadogstatsd.php';
    
    
    # Increment a counter.
    DataDogStatsD::increment('your.data.point');
    
  3. Go to the Metrics explorer page and see that it works!

Log Collection

Available for Agent >6.0

Monitor your PHP log files with the Datadog Agent in order to forward your logs to Datadog. Find specific instructions to generate logs with your logging library.

Data Collected

Metrics

The PHP integration does not include any metric at this time.

Events

The PHP integration does not include any event at this time.

Service Checks

The PHP integration does not include any service check at this time.

Troubleshooting

Need help? Contact Datadog Support.