Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions reference/fleet/running-on-kubernetes-standalone.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,4 +266,24 @@ If you are using Red Hat OpenShift, you need to specify additional settings in t

Refer to [Kubernetes autodiscovery with {{agent}}](/reference/fleet/elastic-agent-kubernetes-autodiscovery.md) for more information.

## Logging considerations

Altering the default logging in a standalone container requires additional considerations. By default the {{agent}} logs to `stderr` and an internal destination so that diagnostics can be properly collected.


To log to a custom filepath, make these changes to the manifest file:
- {{agent}} logging must be configured in the configmap for `agent.yml`:
```yaml
agent:
logging:
level: info
to_files: true # Log to a custom filepath
to_stderr: true # Also log to stderr so that commands such as kubectl logs works as intended
files:
path: ${LOGS_PATH} # Use the env var to determine the logging path.
```
- The `LOGS_PATH` environment variable must be defined as a part of the Daeomonset's container specification.
- The default DaemonSet container args must be changed to remove the `-e` option:
```yaml
args: ["-c", "/etc/elastic-agent/agent.yml"]
```
Loading