About the LogDNA Agent

Learn about LogDNA's agent-based log collection and monitoring features.

What is the LogDNA Agent?

The LogDNA Agent reads log files from the computer it is installed on and uploads the log data to your LogDNA account. The LogDNA Agent runs in the background is required to view your file-based logs in the LogDNA web application.

The LogDNA Agent runs on the following operating systems and platforms:

🚧

Earlier versions of the LogDNA Agents

Note that this document addresses both our Node.js-based (which is sometimes referred to as Agent v1) and the Rust-based agent, formerly referred to as Agent v2.

How do I install the LogDNA agent?

The easiest way to install the LogDNA Agent for your specific operating system or platform is to log in to the LogDNA app and follow the instructions in the product UI for add log sources instructions.

How do I tell the LogDNA agent what to log?

By default, the LogDNA agent automatically logs all .log and extensionless files located under /var/log/, but if you want to log other directories or files, you can use the commands:

#For directories:
sudo logdna-agent -d "/path/to/my/logs"
#For files:
sudo logdna-agent -f "/path/to/my/logfile"

If you need more complex logic, you can also view and set specific logging paths (as well as use glob patterns by editing /etc/logdna.conf. For example:

logdir = /var/log,/myapp/logs/+(name1|name2).log,/etc/myapp/**/*.log

Can I trust the LogDNA agent?

Absolutely! But if you ever want to double check, you can view the source code on GitHub for both Agentv1 and Agent v2 and even build the agent yourself. If you have any questions or feedback, email us at [email protected]

We also love the open source community, so please feel welcome to submit PRs or report any issues you find. Check out our contributing guide for more info.

How do I use host tags?

Host tags allow you to group hosts automatically into dynamic host groups without having to explicitly assign a host to a group within the LogDNA web app. To use tags, ensure the agent is installed on your host and use the following command to add a tag or tags:

sudo logdna-agent -t mytag,myothertag,anothertag

You can also edit the LogDNA configuration file under /etc/logdna.conf and specify the tags there.

tags = mytag,myothertag,anothertag

Keep in mind, even if your hostname or host machine changes, as long as the agent is running with the same tags configured, that host will automatically be added to the dynamic group located under the hosts filter.

How do I override the default hostname?

The LogDNA agent automatically uses the machine's default OS hostname. If you wish to use a different hostname, you can edit the LogDNA configuration file under /etc/logdna.conf and specify the hostname there.

hostname = mynewhostname

Updated 4 months ago

About the LogDNA Agent


Learn about LogDNA's agent-based log collection and monitoring features.

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.