Skip to content

Add --logging-format to cache-server and use ISO8601 timestamps in JSON logs#3904

Open
xrstf wants to merge 3 commits intokcp-dev:mainfrom
xrstf:no-ts-in-logging
Open

Add --logging-format to cache-server and use ISO8601 timestamps in JSON logs#3904
xrstf wants to merge 3 commits intokcp-dev:mainfrom
xrstf:no-ts-in-logging

Conversation

@xrstf
Copy link
Contributor

@xrstf xrstf commented Mar 13, 2026

Summary

  • Adds --logging-format flag support to cache-server
  • Implements custom JSON logger that uses ISO8601 timestamps instead of UNIX timestamps
  • Replaces Kubernetes upstream JSON logger imports with kcp-specific implementation across all commands

Changes

  • cache-server: Added logging options configuration and early initialization of logging format
  • New package pkg/logging/json: Custom JSON logger factory that wraps upstream implementation but uses ISO8601 time encoding
  • Import updates: All commands now import github.com/kcp-dev/kcp/pkg/logging/json/register instead of k8s.io/component-base/logs/json/register

Test plan

  • Build and run cache-server with --logging-format=json flag
  • Verify JSON log output contains ISO8601 formatted timestamps (e.g., "ts":"2026-03-13T10:30:45.123Z") instead of UNIX timestamps
  • Verify all other kcp commands continue to work with the updated imports
* Change "ts" in JSON logging format to be ISO 8601 instead of UNIX timestamps.
* Add `--logging-format` flag to the cache-server.

… instead of UNIX timestamps

On-behalf-of: @SAP christoph.mewes@sap.com
@kcp-ci-bot kcp-ci-bot added dco-signoff: yes Indicates the PR's author has signed the DCO. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Mar 13, 2026
@kcp-ci-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign xmudrii for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kcp-ci-bot kcp-ci-bot added do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 13, 2026
@xrstf
Copy link
Contributor Author

xrstf commented Mar 13, 2026

/kind cleanup

@kcp-ci-bot kcp-ci-bot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Mar 13, 2026
xrstf added 2 commits March 13, 2026 12:54
On-behalf-of: @SAP christoph.mewes@sap.com
On-behalf-of: @SAP christoph.mewes@sap.com
@xrstf
Copy link
Contributor Author

xrstf commented Mar 13, 2026

/retest

2 similar comments
@xrstf
Copy link
Contributor Author

xrstf commented Mar 13, 2026

/retest

@xrstf
Copy link
Contributor Author

xrstf commented Mar 16, 2026

/retest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants