Skip to content

bin: Use proper ISO 8601 format for logging#11463

Open
michael-o wants to merge 1 commit intofluent:masterfrom
michael-o:iso-8601-log-fix
Open

bin: Use proper ISO 8601 format for logging#11463
michael-o wants to merge 1 commit intofluent:masterfrom
michael-o:iso-8601-log-fix

Conversation

@michael-o
Copy link

@michael-o michael-o commented Feb 14, 2026

Instead of using a custom format, use proper extended ISO 8601 datetime format.

Change is straight forward. Output now:

root@135-release-amd64-default-head:/usr/ports/sysutils/fluent-bit # fluent-bit
Fluent Bit v4.2.2
* Copyright (C) 2015-2025 The Fluent Bit Authors
* Fluent Bit is a CNCF graduated project under the Fluent organization
* https://fluentbit.io

______ _                  _    ______ _ _             ___   _____
|  ___| |                | |   | ___ (_) |           /   | / __  \
| |_  | |_   _  ___ _ __ | |_  | |_/ /_| |_  __   __/ /| | `' / /'
|  _| | | | | |/ _ \ '_ \| __| | ___ \ | __| \ \ / / /_| |   / /
| |   | | |_| |  __/ | | | |_  | |_/ / | |_   \ V /\___  |_./ /___
\_|   |_|\__,_|\___|_| |_|\__| \____/|_|\__|   \_/     |_(_)_____/

             Fluent Bit v4.2 – Direct Routes Ahead
         Celebrating 10 Years of Open, Fluent Innovation!

[2026-02-14 16:48:08.479196279] [ info] [fluent bit] version=4.2.2, commit=, pid=51299
[2026-02-14 16:48:08.479304309] [ info] [storage] ver=1.5.4, type=memory, sync=normal, checksum=off, max_chunks_up=128
[2026-02-14 16:48:08.479316303] [ info] [simd    ] disabled
[2026-02-14 16:48:08.479331868] [ info] [cmetrics] version=1.0.6
[2026-02-14 16:48:08.479341850] [ info] [ctraces ] version=0.6.6
[2026-02-14 16:48:08.479426082] [ info] [sp] stream processor started
[2026-02-14 16:48:08.479455774] [ info] [engine] Shutdown Grace Period=5, Shutdown Input Grace Period=2
^C[2026/02/14 16:48:14] [engine] caught signal (SIGINT)
[2026-02-14 16:48:14.437349155] [ warn] [engine] service will shutdown in max 5 seconds
[2026-02-14 16:48:14.437375002] [ info] [engine] pausing all inputs..
[2026-02-14 16:48:15.437451218] [ info] [engine] service has stopped (0 pending tasks)
root@135-release-amd64-default-head:/usr/ports/sysutils/fluent-bit #

Summary by CodeRabbit

  • Style
    • Standardized date separator in visible timestamps from YYYY/MM/DD to YYYY-MM-DD across runtime logs, dump headers, and status/signal messages, producing consistent hyphen-separated dates in emitted logs and diagnostics without changing log content or behavior.

@coderabbitai
Copy link

coderabbitai bot commented Feb 14, 2026

📝 Walkthrough

Walkthrough

Date separators in log and dump timestamp format strings were changed from slashes (/) to dashes (-) across three source files; no other logic, control flow, or API changes were made.

Changes

Cohort / File(s) Summary
Date format updates
src/flb_log.c, src/flb_dump.c, src/fluent-bit.c
Replaced '/' with '-' in timestamp/date format strings used for log, dump, and signal/status prefixes (e.g., YYYY/MM/DD -> YYYY-MM-DD). No functional, error-handling, or API changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • edsiper

Poem

🐰 A tiny hop to tweak the date,
Slashes swapped so logs look straight,
Dashes line the morning light,
Timestamps tidy, neat, and bright,
I nibble code — and dance with delight!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: updating timestamp format across logging components to use ISO 8601 standard with hyphens instead of slashes in the date portion.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7c429e5ee1

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@michael-o michael-o changed the title flb_log: Use proper ISO 8601 format for logging log: Use proper ISO 8601 format for logging Feb 16, 2026
Instead of using a custom format, use proper extended ISO 8601 datetime format.

Signed-off-by: Michael Osipov <michael.osipov@innomotics.com>
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/flb_log.c (1)

731-731: LGTM — correct date separator change.

The YYYY-MM-DD date format is a direct improvement over the previous slash-separated form. One optional note in the context of the PR's stated goal: the resulting format YYYY-MM-DD HH:MM:SS.nnn uses a space rather than T as the date-time separator. Strict ISO 8601 extended format requires T (e.g., 2026-02-14T16:48:08.479196279). RFC 3339 permits space as a human-readable substitute, so this is a deliberate trade-off rather than a bug.

🔎 If strict ISO 8601 is the goal, consider `T` as separator
-                   "%s[%s%i-%02i-%02i %02i:%02i:%02i.%03ld%s]%s [%s%5s%s] ",
+                   "%s[%s%i-%02i-%02iT%02i:%02i:%02i.%03ld%s]%s [%s%5s%s] ",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/flb_log.c` at line 731, The log timestamp format currently uses a space
between date and time in the format string ("%s[%s%i-%02i-%02i
%02i:%02i:%02i.%03ld%s]%s ..."); if you want strict ISO 8601 compliance change
the separator to 'T' in that format string (i.e., replace the space between the
date and time fields with 'T') so the produced timestamp reads
YYYY-MM-DDTHH:MM:SS.nnn; update the format literal in src/flb_log.c where that
string appears.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/flb_log.c`:
- Line 731: The log timestamp format currently uses a space between date and
time in the format string ("%s[%s%i-%02i-%02i %02i:%02i:%02i.%03ld%s]%s ...");
if you want strict ISO 8601 compliance change the separator to 'T' in that
format string (i.e., replace the space between the date and time fields with
'T') so the produced timestamp reads YYYY-MM-DDTHH:MM:SS.nnn; update the format
literal in src/flb_log.c where that string appears.

@michael-o michael-o changed the title log: Use proper ISO 8601 format for logging bin: Use proper ISO 8601 format for logging Feb 20, 2026
Copy link
Contributor

@cosmo0920 cosmo0920 left a comment

Choose a reason for hiding this comment

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

This change could break backward compatibility. So, do we need to provide a service parameter to turn on using ISO 8601 format on log?
This can make a room to merge, I suppose.

@michael-o
Copy link
Author

This change could break backward compatibility. So, do we need to provide a service parameter to turn on using ISO 8601 format on log? This can make a room to merge, I suppose.

If so, I would make if fully compliant. Unfortunately, I have no idea how to introduce a flag for this.
Do you anticipate people parsing the log output?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants