How to collect Zitadel logs for security investigations
A security or platform team running self-hosted Zitadel needs its logs in one searchable place before an incident or audit forces the question. To collect them, run a log shipper that reads Zitadel's container output and forwards it to a store that can be queried by time, user and client. Zitadel writes its runtime, access and action execution logs to stdout, so the shipper, with Fluent Bit or Vector, picks them up from the container runtime, and the store, such as Loki or OpenSearch, makes them searchable. Without both pieces, the logs exist only on the node and are lost when the pod restarts or the node is replaced.
Teams usually need this before go-live, before the first security review, or as soon as the current logs cannot answer a basic question such as who signed in, from where, and which application they used. The three streams answer different questions. Runtime logs show service errors and configuration problems, access logs record the HTTP requests that reach the API and login endpoints, and action execution logs show when custom actions ran and whether they failed. Confirm in your own environment which access log settings your Zitadel version enables by default, because access logging is a configuration decision you should verify rather than assume.
Decide early how long each stream must be kept, who can query it, and whether the store sits inside the same trust boundary as Zitadel. Loki retention is disabled by default, so logs are kept indefinitely until you enable it, which matters both for storage cost and for the retention period your investigators and auditors expect. Plan for log integrity and access control on the store itself, because an investigator needs to trust the record and an attacker who can edit the record can hide their steps. Ask your compliance team which retention period applies to authentication events before you pick a value.
Loki or OpenSearch as the log store for Zitadel
This table compares Grafana Loki and OpenSearch as the store for Zitadel runtime, access and action logs, across query model, storage, tenancy, retention and operating effort. Read each row against how your team already searches logs and what your security investigations need to answer. The main takeaway is that Loki favors label-based log aggregation in a Grafana stack, while OpenSearch favors full-text search and security analytics.
| Decision factor | Grafana Loki | OpenSearch |
|---|---|---|
| Query model | Label-indexed streams queried with LogQL; the full text of each line is not indexed, so searches narrow by labels first | Full-text indexing and search across fields, suited to ad hoc investigation of login failures, client IDs and source addresses |
| Storage on object storage | Compressed chunks and the index sit in object storage; TSDB is the recommended index for Loki 2.8 and newer; S3, Google Cloud Storage and Azure Blob are the recommended production stores | Primarily index-backed storage on nodes; confirm the supported approach to snapshots and cold or archived data for your chosen version |
| Deployment modes | Monolithic, simple scalable (being deprecated and removed with Loki 4.0) and microservices; choose the mode by daily log volume | Clustered deployment with dedicated node roles; sizing depends on indexing rate, shard count and retention, so confirm limits for your version |
| Multi-tenancy | Enabled with auth_enabled and the X-Scope-OrgID header on each request; tenant separation is a configuration choice | Tenant and access separation through index patterns, roles and security settings; confirm the model against your version and license tier |
| Authentication | No built-in authentication layer; place an authenticating reverse proxy such as nginx, HAProxy, OAuth2 Proxy or Pomerium in front | Security features and SSO options depend on the distribution and license; confirm which are included in your setup |
| Retention control | Disabled by default, so logs persist until retention is enabled in the compactor; rules can apply globally, per tenant or per stream, each at least 24 hours | Retention is handled through index lifecycle policies; confirm the policy options and how they apply to security indices |
| Operating effort | Fewer moving parts when Grafana is already run; ongoing work covers object storage lifecycle, compactor health and reverse proxy policy | Cluster capacity, shard management, index templates and upgrades usually need dedicated skills; plan for this effort |
| Best fit | Teams already running Grafana who want low-cost aggregation, correlation with metrics and traces, and Zitadel dashboards | Teams that need full-text search, security analytics, detection content and investigators working outside Grafana |
How log lines travel from Zitadel stdout to your store
The path starts where Zitadel writes its runtime and access output to stdout inside each pod or process. A node-level or sidecar shipper, Fluent Bit or Vector, reads those lines and forwards them over the network to the log store, Loki or OpenSearch. Readers reach the stored logs only through an authenticated proxy in front of Grafana or OpenSearch Dashboards. Check each hand-off: the access-logging reverse proxy in front of Zitadel must write its own lines to stdout, the shipper must not drop them under load, and the store's write path must be reachable only from inside the cluster.
Log flow from Zitadel stdout through a shipper to the store, with trust boundaries marked.
Why Fluent Bit or Vector fits the collection layer
The shipper is the component that reads Zitadel's stdout, parses each record into fields, attaches labels such as the component name and environment, buffers what it cannot yet deliver, and forwards the result to Loki or OpenSearch. Zitadel writes its runtime, access and action execution output to the container or process stdout, so the shipper must be able to read that stream reliably across pod restarts and rotations. Fluent Bit is a reasonable default for this role because it is an Apache-2.0 licensed, lightweight agent written in C, it supports native OpenTelemetry (OTLP) ingestion and delivery, and Loki is listed among the clients that can send logs to it. Loki also accepts logs from Fluent Bit and from Grafana Alloy, which Grafana describes as its supported log shipper, so the choice between them is about your operating model rather than whether Loki can receive the data.
Vector is the other common option for this layer. Its capabilities, supported sinks, transform language and release cadence change over time, so confirm them against the current Vector documentation before you choose it, and record the version you tested. Whichever tool you pick, verify three things in a test environment before go-live. First, the parser for the Zitadel log format: confirm the exact fields your Zitadel version emits and that a multiline or JSON parser keeps each record intact. Second, the labeling: keep label cardinality low, because high-cardinality values such as user IDs belong in the log body, not in Loki stream labels. Third, the buffering and retry settings, including the storage type, buffer limits and what happens when the backend is unavailable, since a silent drop during an outage is the failure you most need to rule out.
Ask your team to write down the tool choice, its version, the parser definition and the buffer limits as part of the deployment record. An investigator later will need to know whether a gap in the logs came from Zitadel, the shipper or the backend, and that answer depends on these settings being documented and tested rather than left at defaults.
Setup sequence for shipping Zitadel logs
This sequence takes a self-hosted Zitadel from unshipped stdout to a log store where a test login can be found by its timestamp and request identifier. Each step ends with a check, so a gap is caught at the stage where it was introduced.
Confirm the Zitadel version and log destinations
Record the exact Zitadel release you run, the deployment method (Kubernetes with the official Helm chart, Docker Compose or binaries) and the component that writes each log stream. Zitadel is usually run as a container or process whose stdout your platform captures, so confirm where that output lands on each node or pod. Check the release notes for the version you run before changing any logging setting, because log field names can change between releases. Done when you have a written inventory that lists every Zitadel component, its runtime and where its output is collected.
Enable access logging and confirm the log format
Open the Zitadel configuration reference for your version and find the settings that control access logging and log format. Turn on access logs in a non-production environment first, then read the raw output from a few requests to confirm the fields you need are present, including timestamp, request path, status and a request identifier. Decide the format (text or JSON) with your log parser in mind, since structured output is simpler to query. Done when a manual request produces a stdout line containing all the fields your investigations will depend on.
Deploy the shipper with namespace, pod and instance labels
Deploy Fluent Bit or Vector as a node-level agent that reads container stdout and forwards it to your chosen store. Attach labels for Kubernetes namespace, pod name and Zitadel instance so each line can be filtered by environment and by tenant boundary later. Keep the label set small and stable, because high-cardinality labels make the log store harder to query and operate. Done when the shipper's own logs show it is reading Zitadel pods and sending records without errors, and a sample record carries all three labels.
Deploy the log store with retention and tenant settings
Deploy Loki or OpenSearch on storage you control, and decide how long security-relevant Zitadel logs must be kept under your own policy. For Loki, retention is disabled by default, so set the compactor retention explicitly and enable multi-tenancy with a tenant identifier if you separate environments. For OpenSearch, define index lifecycle rules and access roles before ingesting. Done when a test record is stored, and you can show the retention setting and the tenant or role boundary in the running configuration.
Place an authenticating reverse proxy in front of Loki
If you use Loki, run an authenticating reverse proxy such as nginx, HAProxy, OAuth2 Proxy or Pomerium in front of it, because Loki has no built-in authentication layer. Route the shipper and the query interface through the proxy, and make sure the tenant header is set by the proxy rather than trusted from the client. Limit direct access to Loki's ports at the network level. Done when an unauthenticated request to the Loki endpoint is refused and an authenticated query returns the test record.
Verify with a test login and request identifier
Perform a test login through the Zitadel console or a test application, note the approximate time and the request identifier shown in the response or access log, then search the log store using the timestamp and that identifier. The search should return the access line from Zitadel with the matching status and path. Repeat the test from a second instance or namespace to confirm the labels separate the records. Done when both searches return the expected lines, and the results are saved as the baseline for later investigations.
Confirm the sequence with your security team
Ask your security and compliance team to review the retention period, the access controls on the log store and the fields recorded for logins and administrative actions. Confirm with them which fields they need for investigation and whether personal data in logs must be masked. Record the decisions alongside the configuration so future changes can be checked against them. Done when the review is documented and any gaps are assigned to an owner with a follow-up date.
Collection settings by Zitadel deployment environment
The official Helm chart runs Zitadel as pods, and the container runtime captures each container's stdout and stderr to node-level log files. The usual placement is a DaemonSet running Fluent Bit or Vector on every node, which reads those files and enriches records with pod and namespace metadata. A sidecar is useful only when a pod must write to a file instead of stdout, which is not the default path for Zitadel.
- Stdout capture: The kubelet and container runtime write container output to files on each node, so the shipper reads from the node, not from inside the Zitadel container.
- Shipper placement: A DaemonSet covers all nodes, including nodes that gain Zitadel pods during scaling or failover.
- Rotation: Confirm the node's log rotation limits, because short retention on busy nodes can drop lines before the shipper reads them.
- Buffering: Confirm the shipper's on-disk buffer location and size so that a Loki or OpenSearch outage does not lose records.
- Labels: Confirm which pod labels the shipper attaches so that Zitadel records can be filtered by release and environment.
Before go-live, confirm the exact log output settings, the access log switch and any key names in Zitadel's self-hosting documentation, and test rotation on a non-production cluster.
In Docker Compose, the Docker engine captures each container's stdout and stderr, and the default json-file logging driver writes them to files on the host. You can run the shipper as another service in the same Compose project that reads those host files, or use a logging driver that forwards records to the shipper. Loki also accepts the Docker logging driver directly, which removes one hop but ties collection to the Docker host.
- Stdout capture: The Docker daemon stores container output through the configured logging driver, so confirm which driver is active for the Zitadel service.
- Shipper placement: Run one shipper container per Docker host with read-only access to the log directory, rather than one per Zitadel container.
- Rotation: Confirm the
max-sizeandmax-fileoptions for the logging driver, since these control how much history exists on disk. - Persistence: Confirm that the shipper's buffer and position files sit on a volume that survives container recreation.
- Service restarts: Confirm that the shipper restarts with the host, so records written during downtime are picked up.
Review the Zitadel self-hosting documentation for the exact log settings to enable, and confirm the Compose file keys against your Docker Engine version before relying on them.
When Zitadel runs as a Linux binary under systemd, its stdout and stderr are captured by journald by default unless the unit redirects output to a file. A shipper on the same host, such as Fluent Bit or Vector, reads the journal with its journald input and forwards records to Loki or OpenSearch. This is an agent on the host, not a sidecar or DaemonSet.
- Stdout capture: Under the default setup, journald stores the service output, and you can filter it by the unit name.
- Shipper placement: Run the agent as its own systemd service with access to the journal, and start it after the network and the Zitadel unit.
- Rotation: Confirm journald's storage and retention settings, including whether the journal is persistent across reboots, since volatile storage loses history at restart.
- File redirection: If the unit writes to a file instead, confirm the file path, its rotation policy and the shipper's read position handling.
- Position tracking: Confirm where the shipper stores its read offsets so that a restart does not duplicate or skip records.
Confirm the exact binary flags, file paths and log keys in Zitadel's self-hosting documentation for the deployment option you use, because the unit file layout depends on your install method.
Security risks in a Zitadel log pipeline
A log pipeline for Zitadel gathers identity events, request details and account activity in one place, which makes it a high-value target. The risks below cover what gets logged, who can reach the store, how shipper credentials are handled, whether logs can be altered, how long they are kept and how tenants are separated. Each card names the control and what to verify before go-live.
Personal data and tokens in logs
Request and error logs can carry user identifiers, email addresses, IP addresses and, if verbosity is set high, values that behave like credentials. Once these reach a shared dashboard, anyone with dashboard access can read them, which widens exposure well beyond the identity team. Before go-live, sample real log lines from each container and confirm that tokens, authorization headers, passwords and client secrets are absent or masked. Agree with your privacy team which fields are kept and for how long.
Unauthenticated log endpoints
Loki has no built-in authentication layer, and its documentation says an authenticating reverse proxy must sit in front of it. An OpenSearch cluster left without its security plugin or network restriction offers the same exposure. Anyone who reaches the ingest or query port can read identity events or write false ones. Verify that the store listens only on a private network, that every query and push path goes through an authenticated proxy, and that direct access from workstations is blocked.
Loki authentication docsShipper credentials in plain configuration
Fluent Bit, Vector or Alloy configuration files often hold basic auth passwords, bearer tokens or client certificates for the log store. Stored in a ConfigMap, a Git repository or a world-readable file, these credentials let anyone on the node push or read logs. Load them from a secrets manager or a Kubernetes Secret, restrict file permissions, and rotate them on a schedule. Confirm that the shipper's service account can write only to its own tenant or index.
Administrators altering stored logs
Anyone with write or delete access to the object store, index or database can remove or edit entries after an incident. Investigators then cannot trust the record, and the gap may be the event they most need. Limit delete rights to a small group, separate them from Zitadel administrator roles, and forward a copy to a second location with write-once settings where the platform supports it. Ask your storage team to show how deletions are logged and reviewed.
Retention too short for investigations
Loki retention is disabled by default, which keeps logs indefinitely until retention is configured, so a short period usually comes from a deliberate setting or a storage quota. Identity incidents such as credential stuffing or account takeover can surface weeks after the first event. Decide the retention period with security and legal teams before go-live, set it per stream where personal data needs shorter keeping, and test that a sample query still returns logs from the window you promised.
- Loki retention default
- Disabled
Tenant identifiers that route logs wrongly
Loki treats a deployment as multi-tenant when auth_enabled is true, and it identifies each tenant with the X-Scope-OrgID header on every request. If a shipper, proxy or pipeline rule sets that header incorrectly or leaves it blank, one organization's identity events can appear in another's queries. This matters most where Zitadel serves several customer organizations. Test with two synthetic tenants, confirm that a query under one header never returns the other's events, and review every rule that sets the header.
Loki multi-tenancy docsQuestions teams ask before collecting Zitadel logs
How much effort does a Zitadel log collection setup take?
The effort depends less on the shipper than on the number of Zitadel instances, the volume of logs they produce, and the access controls you need on the stored data. A single instance shipping stdout to one store with one dashboard is a small, bounded task. Each added instance, each added environment and each team that needs its own view adds configuration, testing and review work. Ask any partner to split the estimate into four parts: shipper configuration, log store deployment, access control in front of the dashboard, and retention and alerting rules. Those four parts are where most of the time goes, and each one should appear as a separate line in a written scope.
Can our in-house team set up Zitadel logging without a partner?
Yes, if your team already runs Kubernetes or Linux services, operates a log store and has someone who owns access control for internal tools. Fluent Bit and Vector both read container stdout, and Zitadel writes its runtime, access and action execution logs there, so the collection path itself is standard work. The harder parts are usually the store and its access model. Loki has no built-in authentication layer and its documentation says you must run an authenticating reverse proxy in front of it, so someone has to own that proxy, its SSO integration and its upgrades. If none of those skills exist in-house, a partner can close that gap.
Which log store should we choose for Zitadel logs?
Loki and OpenSearch both fit this job, and the choice follows from your existing stack and query needs. Loki indexes labels rather than full log text and stores compressed chunks and its index in object storage, which keeps the index small for high-volume streams. OpenSearch offers full-text search and suits teams that already run it for security analytics. Loki's recommended production object stores are Amazon S3, Google Cloud Storage and Azure Blob Storage, while S3-compatible stores such as MinIO are supported but not typically recommended for production. If you run a self-hosted object store, confirm that choice against the Loki storage documentation before committing.
How much log volume can a Loki setup handle?
Loki's documented deployment modes set the scale context. The monolithic mode runs as a single binary and is documented for up to about 20 GB of logs per day. The simple scalable mode, with separate read, write and backend targets, is documented as approaching 1 TB per day, but Loki's documentation states that this mode is being deprecated and will be removed with the Loki 4.0 release, so plan new builds around the microservices mode or confirm the current guidance. Your daily volume depends on how many instances you run, how verbose the access logs are and how many action executions you record. Measure a representative week before choosing a mode.
Why does retention drive the long-term cost of Zitadel logs?
Retention is the largest recurring cost driver after volume, because logs are kept indefinitely unless you enable retention. Loki applies retention through the compactor, which is disabled by default, so a fresh install will keep every log until you set retention_enabled. Retention can be global, per tenant or per stream selector, and each stream rule must be at least 24 hours. Security investigations need a defined window, and your compliance or legal team should set that window in writing before you tune rules. Object storage is paid by the month, so the total cost follows the volume multiplied by the number of days you keep it.
What do we need to provide before a partner starts this work?
A partner needs a clear picture of your Zitadel deployment and your observability and access model. Prepare a list of Zitadel instances and the environments they run in, the cluster or host where logs are written, the object storage or log store you already run, and the identity provider that will guard dashboards. Add your retention requirements from security and compliance, the people who need read access and the people who must not see certain logs, and any existing Grafana, Graylog or SIEM tooling the logs must reach. Also confirm who will own the system after handover, because that decides the runbooks and access reviews the partner delivers.
Which Zitadel logs are worth keeping for security investigations?
Keep the logs that answer who did what, from where and when, and keep them in a store that users with dashboard access cannot edit. Access logs show requests reaching Zitadel, and action execution logs show what your custom actions did during logins and user changes, so both matter when you reconstruct an event. Runtime logs help explain failures and configuration changes. Confirm with your Zitadel documentation which access logging settings your version exposes, since enabling access logs is a configuration step you must verify on your release rather than assume. Set the retention window and alert rules from your investigation procedures, not from the shipper's defaults.
What to keep for security investigations
The records an investigation needs are sign-in and failed sign-in events, administrator and console actions, action execution logs, token and client activity where Zitadel logs it, and access logs that carry a timestamp, client address and request path. Failed sign-ins matter as much as successful ones, because password spraying and credential stuffing show up as bursts of failures across many accounts. Administrator and console actions tell you who changed an organization, identity provider, role or grant, and when. Before go-live, confirm with your own Zitadel version which events are written to stdout, which are only available through the API, and whether token and client activity appears in runtime logs at all. Map each record type to a question you expect to answer, such as which account was used from an unfamiliar address last week.
Retention is a decision you must make, not a default you inherit. Loki keeps logs indefinitely until retention is enabled, because the compactor's retention is disabled by default. You can set retention globally, per tenant or per stream selector, and each stream rule must be at least 24 hours. Use separate rules for sign-in and administrator records, which investigators and auditors usually need for longer, and for high-volume access logs, which may need shorter periods. Agree these periods with your legal, privacy and audit teams, and record the reason for each one, since the same data may be personal data with its own limits on how long it may be held.
Legal hold, integrity controls and copies outside the primary store also need an explicit decision. A legal hold may require suspending deletion for specific tenants or streams, which means retention rules must be changeable without losing the evidence already collected. Integrity controls, such as write-once object storage, access separation between the people who run the logging stack and the people who review it, and checksums on exported archives, help show that records were not altered. Copies in a separate account or site protect against loss of the primary store but widen the set of systems that hold personal data. Confirm each of these choices against your own incident response and records policy, and do not assume the logging stack provides them.
Limits to confirm in your environment
The logging design for self-hosted Zitadel depends on a handful of versioned facts: which log fields and access log settings your release emits, how much log volume you will produce, and which shipper and store versions your team can support. Confirm each item against the vendor documentation or a test in your own environment before you commit to a retention plan or a storage budget.
Zitadel log fields and access settings
Field names, log levels and the access log switch can differ between Zitadel releases, and your security team's detection rules depend on them. Pull the configuration reference for the exact version you run and confirm which fields appear on runtime, access and action execution lines. Then send a test login, a failed login and an API call through a non-production instance and inspect the raw stdout. Record the field names in your parsing rules so a later upgrade does not silently break them.
Zitadel self-hosting docsLoki deployment mode fit
Loki documents monolithic mode for up to about 20 GB of logs per day, while simple scalable mode is deprecated and will be removed with Loki 4.0. If your projected daily volume is above the monolithic range, plan for microservices or a supported scalable layout from the start rather than building on a mode with a removal date. Measure real volume from a pilot instance, including access logs and action execution logs, before you pick a mode.
Loki deployment modes docsObject storage choice
Loki keeps compressed chunks and its index in object storage, and its documentation recommends Amazon S3, Google Cloud Storage or Azure Blob Storage for production. S3-compatible stores such as MinIO and local filesystems are supported but not typically recommended for production. If your data must stay on premises, confirm with the Loki storage documentation and your own load test how your chosen store performs, and who owns its durability, encryption and backups.
Loki storage docsRetention enabled by default
Loki's compactor applies retention, but retention is disabled by default, so logs are kept indefinitely until you set retention_enabled. Security investigations need a defined window, and your legal and compliance owners need to agree on it. Confirm the global, per-tenant and per-stream rules in the retention docs, and test that deletion runs as expected in staging before the first production log arrives.
Loki retention docsShipper version support
Fluent Bit and Vector both move quickly, and the Fluent Bit release line in use today includes several point releases within weeks of each other. Confirm which Fluent Bit version your Loki release accepts, and whether your chosen Vector or OpenSearch version supports the output plugin and TLS settings you need. Pin the shipper version, run it against a test Zitadel instance, and retest after every upgrade of either side.
Fluent Bit releasesOpenSearch or Vector fit
If you choose OpenSearch as the store, confirm that its version meets your search, index lifecycle and access control needs, and that the shipper can write to it with the authentication method your team uses. Vector's transforms and sinks also vary by version. Check the release notes for the versions you plan to run, then run a sample search for a single user's failed logins to confirm the fields are indexed the way your analysts expect.
How DeployOpen scopes and delivers Zitadel log collection
DeployOpen plans, builds, documents and supports the log pipeline for your self-hosted Zitadel inside your own infrastructure. The work covers runtime, access and action execution logs, the shipper, the storage backend and the retention and access controls your security team needs for investigations.
How we scope
- Engagements are fixed-scope, with the log sources, shipper, storage backend and retention periods agreed in writing before work starts.
- The written scope names which Zitadel log streams are collected, including whether access logs are enabled and where they are written.
- We confirm with your security team which events they must be able to search, who may read them and how long they must be kept.
How we build
- We configure Zitadel logging on your deployment and ship stdout logs with Fluent Bit or Vector to your chosen store.
- We set up Loki or OpenSearch in your environment, with retention rules, tenant or index separation and an authenticating proxy in front of the query path.
- We test that each log stream arrives, is parsed with the expected fields and can be found by the searches your investigators will run.
How we hand over
- You receive configuration, the shipper and store setup, and a runbook describing how each log stream is collected and retained.
- We document access roles for the log store, retention settings, and the steps to confirm log delivery after an upgrade or change.
- We walk your operations and security staff through search examples and an investigation drill using the delivered setup.
How we support
- Ongoing support, upgrades and continuous testing are available as a retainer, covering shipper and store version changes.
- We can review log coverage after Zitadel upgrades or changes to the deployment to confirm nothing has silently stopped.
- Ask your DeployOpen contact for a quote based on the written scope, which sets the retention, volume and access requirements.

