View Source LoggerJSON.Formatters.DatadogLogger (logger_json v5.1.4)

DataDog formatter. This will adhere to the default standard attribute list as much as possible.

Options

This formatter has a couple of options to fine tune the logging output for your deployed environment.

hostname

By setting the hostname value, you can change how the syslog.hostname is set in logs. In most cases, you can leave this unset and it will use default to :system, which uses :inet.gethostname/0 to resolve the value.

If you are running in an environment where the hostname is not correct, you can hard code it by setting hostname to a string. In places where the hostname is inaccurate but also dynamic (like Kubernetes), you can set hostname to :unset to exclude it entirely. You'll then be relying on dd-agent to determine the hostname.