Documentation
Datadog
Table of Contents ▼
Presentation
Datadog is a service that allows − in particular − to centralize the logs of your applications within a single interface. This can be very handy when your web application is spread across multiple servers and it becomes difficult to track multiple log files simultaneously.
Configuration
In the temma.json configuration file, add the \Temma\LogManagers\Datadog object to the logManager directive.
You must also add an x-datadog extended configuration, with the following keys:
-
url: (required) Datadog API connection URL, depending on the location you chose
- EU: https://http-intake.logs.datadoghq.eu/api/v2/logs
- US: https://http-intake.logs.datadoghq.com/api/v2/logs
- US3: https://http-intake.logs.us3.datadoghq.com/api/v2/logs
- US5: https://http-intake.logs.us5.datadoghq.com/api/v2/logs
- US1-FED: https://http-intake.logs.ddog-gov.com/api/v2/logs
- apiKey: (required) Your API key
- service: (optional) Name of the service (website or application) sending the log
Here is an example configuration:
{
"application": {
"logManager": "\\Temma\\LogManagers\\Datadog"
},
"x-datadog": {
"url": "https://http-intake.logs.datadoghq.eu/api/v2/logs",
"apiKey": "...API_KEY...",
"service": "temma.net"
}
}
Usage
In the Datadog web interface, it is recommended to create two facets:
- Traceid, which will contain a string of four characters, allowing to identify the logs coming from the same execution.
- Class, which will contain the log recording class.
You can add these facets as columns in the general monitoring table, this will make reading the log stream more explicit.
Previous: | Log managers |
Next: | Controllers |
Table of Contents
- Migration : How to upgrade from Temma 1.x to version 2
- Installation : Download Temma and install it to start your web project
- Configuration : All the configuration directives of the etc/temma.json file and the optional environment variables
- External libraries : How to use external function libraries
- Routing : Temma's default routing system, and advanced routing
-
Log :
Use of the log system, management by criticality levels
- Log managers : How to create your own log managers
- Syslog : To send your logs to a Syslog server
- Datadog : To send your logs to the Datadog service
- Controllers : Essential parts of your web application
- Views : Smarty templates or JSON/CSV/RSS/iCal/INI exports
- Dependency injection : The backbone of your application developments
- Sessions : Extension of user sessions managed by PHP
- Data sources : Unified data access management
- Model : How to use DAOs to access databases
- Execution flow : How to manage the execution flow, between plugins and the controller
- Plugins : How to use plugins, and create your own plugins to modularize your code
- Attributes : How to filter access to controllers and actions
- Command-line interface : To create executable scripts on the command line, automatically initialized by Temma
- Helpers : Items offered by Temma to help you in various circumstances