You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 7, 2025. It is now read-only.
feat: Delete Log with Cron and Refacto Logging Config
Delete log with a cron that trigger at midnight.
Also refactored logging config so that the developer does not have to do anything with copy/pasting the config, only setting ENV values will be good.
Closes#13
DATADOG_PERMISSIONS=0644 // Default to 0644 if no value provided
29
+
DATADOG_LEVEL="info" // Default to info if no value provided
30
+
DATADOG_BUBBLE=true // Default to true if no value provided
31
+
35
32
3) Add `LOG_CHANNEL="datadog-agent"` in your `.env` file OR include `datadog-agent` channel into your stack log channel.
36
33
4) Enable logs by setting `logs_enabled: true` in the default `/etc/datadog-agent/datadog.yaml` file on the server where the project is hosted.
37
34
5) Choose only one config between those 3 files to put in `/etc/datadog-agent/conf.d/laravel.d/` (create the `laravel.d` folder if it doesn't exist) :
38
-
1) <ahref="https://github.com/myLocalInfluence/laravel-datadog-logger/blob/master/conf/cli-only/conf.yaml">Logging only php-cli</a>
39
-
2) <ahref="https://github.com/myLocalInfluence/laravel-datadog-logger/blob/master/conf/fpm-only/conf.yaml">Logging only php-fpm</a>
40
-
3) <ahref="https://github.com/myLocalInfluence/laravel-datadog-logger/blob/master/conf/cli-fpm/conf.yaml">Logging php-fpm and php-cli</a>
35
+
1) <ahref="https://github.com/myLocalInfluence/laravel-datadog-logger/blob/master/config/agent/cli-only/conf.yaml">Logging only php-cli</a>
36
+
2) <ahref="https://github.com/myLocalInfluence/laravel-datadog-logger/blob/master/config/agent/fpm-only/conf.yaml">Logging only php-fpm</a>
37
+
3) <ahref="https://github.com/myLocalInfluence/laravel-datadog-logger/blob/master/config/agent/cli-fpm/conf.yaml">Logging php-fpm and php-cli</a>
41
38
6) Restart your DataDog Agent and watch your result <ahref="https://app.datadoghq.com/logs/livetail">here</a>.
42
39
43
40
Notes: At this time the `source` metadata from the DataDogFormatter is not taken care by DataDog so that's why we are specifying it in the `/etc/datadog-agent/conf.d/laravel.d/conf.yaml` file.
44
41
45
42
## 2) How to use in API Style
46
43
47
-
1)Add in your `config/logging.php` the following under `channels` tab:
44
+
1)Please fill in your .env the following values (<ahref="https://app.datadoghq.com/account/settings#api">How to obtain ApiKey ?</a>) :
48
45
49
-
'datadog-api' => [
50
-
'driver' => 'custom',
51
-
'via' => \Myli\CreateDataDogLogger::class,
52
-
'apiKey' => env('DATADOG_API_KEY'),
53
-
'region' => 'eu', // eu or us
54
-
'level' => 'info', // choose your minimum level of logging.
55
-
'bubble' => true,
56
-
],
46
+
`DATADOG_API_KEY="YOUR_API_KEY"
47
+
DATADOG_REGION="eu|us" // Default to eu if no value provided
48
+
DATADOG_LEVEL="info" // Default to info if no value provided
49
+
DATADOG_BUBBLE=true // Default to true if no value provided`
57
50
58
51
2) And finally add `LOG_CHANNEL="datadog-api"` in your `.env` file OR include `datadog-api` channel into your stack log channel.
59
-
3) The only custom options are `region` (values can be `us|eu`) and `apiKey` which you can find <ahref="https://app.datadoghq.com/account/settings#api">here</a>
60
52
61
53
## If you ❤️ open-source software, give the repos you use a ⭐️.
62
54
We have included the awesome `symfony/thanks` composer package as a dev
0 commit comments