How to enable Log collection in Datadog?
To enable log collection with an Agent running on your host, change logs_enabled: false to logs_enabled: true in the Agentโs main configuration file (datadog.yaml).

Custom Log Collection in Datadog
Datadog Agent v6 can collect logs and forward them to Datadog from files, the network (TCP or UDP), journald, and Windows channels:
- Create a new
<CUSTOM_LOG_SOURCE>.d/folder in theconf.d/directory at the root of your Agentโs configuration directory. - Create a new
conf.yamlfile in this new folder. - Add a custom log collection configuration group with the parameters below.
- Restart your Agent to take into account this new configuration.
- Run the Agentโs status subcommand and look for
<CUSTOM_LOG_SOURCE>under the Checks section.
Log Type in Datadog

Log Type: File

Log Type: TCP/UDP

Log Type: journald

Log Type: Windows Events


- Install the Datadog Agent
- Verify Datadog Agent Status and Look for "Logs Agent" which is not running.
$ sudo datadog-agent status
- Enable log collection
To enable log collection with the Agent, edit the datadog.yaml configuration file located at /etc/datadog-agent/datadog.yaml and set logs_enabled:true
- Monitor a custom file
$ sudo mkdir /etc/datadog-agent/conf.d/custom_log_collection.d/
$ sudo vi /etc/datadog-agent/conf.d/custom_log_collection.d/conf.yaml
logs:
- type: file
path: /var/log/syslog
source: syslog
service: syslog
$ sudo service datadog-agent restart
- Validation. Verify
$ sudo datadog-agent status
Datadog Agent Status and Look for "Logs Agent" which is running.
$ chmod -R 755 /var/log/
$ datadog-agent statusCode language: PHP (php)


I’m Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms.
I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.
Find Trusted Cardiac Hospitals
Compare heart hospitals by city and services โ all in one place.
Explore Hospitals
Thanks for the clear Datadog log collection tutorial! I found the stepโbyโstep configuration process really helpful โ it made understanding how to set up log collection much easier. Great resource for anyone working with observability and monitoring!