Skip to content

K8SPS-500 Documented persistent logging - #267

Draft
nastena1606 wants to merge 1 commit into
mainfrom
K8SPS-500-Persistent-logging
Draft

nastena1606 wants to merge 1 commit into
mainfrom
K8SPS-500-Persistent-logging

Conversation

@nastena1606

Copy link
Copy Markdown
Collaborator

modified: docs/architecture.md
modified: docs/debug-logs.md
modified: docs/features.md
new file: docs/logrotate.md
modified: docs/operator.md
new file: docs/persistent-logging.md
modified: docs/what-next.md
modified: mkdocs-base.yml

modified:   docs/architecture.md
        modified:   docs/debug-logs.md
        modified:   docs/features.md
        new file:   docs/logrotate.md
        modified:   docs/operator.md
        new file:   docs/persistent-logging.md
        modified:   docs/what-next.md
        modified:   mkdocs-base.yml

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Several examples use an undefined image-version variable, and the rotation guidance contains lifecycle and configuration errors.

Review effort: Balanced
Findings: 5 Medium severity · 3 Low severity

Open (8)
What changed in this PR

Documents persistent logging and log rotation for MySQL Pods.

Changes:

  • Adds logging setup, customization, and rotation guides.
  • Documents new logcollector Custom Resource fields.
  • Integrates logging guidance into navigation and related pages.
File Description
mkdocs-base.yml Adds logging navigation.
docs/​what-next.md Links persistent logging guidance.
docs/​persistent-logging.md Adds the persistent logging guide.
docs/​operator.md Documents logcollector fields.
docs/​logrotate.md Adds log rotation guidance.
docs/​features.md Lists persistent logging capabilities.
docs/​debug-logs.md Explains access to collected logs.
docs/​architecture.md Adds logging sidecars to the architecture overview.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread docs/logrotate.md
spec:
logcollector:
enabled: true
image: perconalab/fluentbit:{{fluentbitrecommended}}
Comment thread docs/logrotate.md
namespace: <namespace>
data:
slow.conf: |
/var/lib/mysql/log/slow.log {
Comment thread docs/operator.md

| Value type | Example |
| ----------- | ---------- |
| :material-code-string: string | `perconalab/fluentbit:{{fluentbitrecommended}}` |

The collector tails files in two directories.

**MySQL error log.** Fluent Bit tails every `*.log` and `*.err` file in `/var/lib/mysql/log`. The Operator points only the error log at that directory. To collect the slow query log or the general log as well, set `slow_query_log_file` or `general_log_file` to a path under `/var/lib/mysql/log` in your MySQL configuration.
....
logcollector:
enabled: true
image: perconalab/fluentbit:{{fluentbitrecommended}}
Comment thread docs/logrotate.md

Set `spec.logcollector.logRotate.configuration` to replace the Operator-managed `mysql.conf` snippet.

You must provide the full configuration because this field replaces the built-in rules. Refer to the [default configuration :octicons-link-external-16:](https://github.com/percona/percona-server-mysql-operator/blob/main/build/logcollector/logrotate/logrotate.conf) for the built-in rules when you define your snippet.
Comment thread docs/operator.md

### `logcollector.logRotate.extraConfig.name`

Name of a ConfigMap in the same namespace that holds extra `logrotate` rules. Each key must end with `.conf`. Do not use `mysql.conf` as the name. That name is reserved for the Operator-managed configuration. See [Add extra rules from a ConfigMap](logrotate.md#add-extra-rules-from-a-configmap).

**MySQL error log.** Fluent Bit tails every `*.log` and `*.err` file in `/var/lib/mysql/log`. The Operator points only the error log at that directory. To collect the slow query log or the general log as well, set `slow_query_log_file` or `general_log_file` to a path under `/var/lib/mysql/log` in your MySQL configuration.

**Percona XtraBackup logs.** During a backup, the `xtrabackup` container writes command output to the `/var/log/xtrabackup/<backup-name>.log` file and to its own standard error. Fluent Bit tails `*.log` in that directory. The directory is an `emptyDir` volume. Kubernetes deletes it when the Pod is removed, so XtraBackup log files do not survive a Pod restart. After a restart, use the `xtrabackup` container's standard error from the previous container, if Kubernetes still has it (`kubectl logs <pod> -c xtrabackup --previous`).

This branch was successfully deployed

1 active deployment
K8SPS-500-Persistent-logging - k8sps-docs-preview PR #267 — c3511603 Deployed Oct 5, 2026 by nastena1606
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants