---
description: Learn how to use the Journald logging driver with Docker Engine
keywords: journald, systemd-journald, docker, logging, driver
title: Journald logging driver
aliases:
- /engine/reference/logging/journald/
- /engine/admin/logging/journald/
- /config/containers/logging/journald/
---
The `journald` logging driver sends container logs to the
[`systemd` journal](https://www.freedesktop.org/software/systemd/man/systemd-journald.service.html).
Log entries can be retrieved using the `journalctl` command, through use of the
`journal` API, or using the `docker logs` command.
In addition to the text of the log message itself, the `journald` log driver
stores the following metadata in the journal with each message:
| Field | Description |
| :----------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `CONTAINER_ID` | The container ID truncated to 12 characters. |
| `CONTAINER_ID_FULL` | The full 64-character container ID. |
| `CONTAINER_NAME` | The container name at the time it was started. If you use `docker rename` to rename a container, the new name isn't reflected in the journal entries. |
| `CONTAINER_TAG`, `SYSLOG_IDENTIFIER` | The container tag ([log tag option documentation](log_tags.md)). |
| `CONTAINER_PARTIAL_MESSAGE` | A field that flags log integrity. Improve logging of long log lines. |
| `IMAGE_NAME` | The name of the container image. |
## Usage
To use the `journald` driver as the default logging driver, set the `log-driver`
and `log-opts` keys to appropriate values in the `daemon.json` file, which is
located in `/etc/docker/` on Linux hosts or
`C:\ProgramData\docker\config\daemon.json` on Windows Server. For more about
configuring Docker using `daemon.json`, see
[daemon.json](/reference/cli/dockerd.md#daemon-configuration-file).
The following example sets the log driver to `journald`:
```json
{
"log-driver": "journald"
}
```
Restart Docker for the changes to take effect.
To configure the logging driver for a specific container, use the `--log-driver`
flag on the `docker run` command.
```console
$ docker run --log-driver=journald ...
```
## Options
Use the `--log-opt NAME=VALUE` flag to specify additional `journald` logging
driver options.
| Option | Required | Description |
| :------------- | :------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |