Skip to content

[backport 2.11] log: fix truncating log message to 1024 bytes in 'json' log#11143

Merged
Totktonada merged 1 commit intotarantool:release/2.11from
grafin:backport/release/2.11/10952
Feb 12, 2025
Merged

[backport 2.11] log: fix truncating log message to 1024 bytes in 'json' log#11143
Totktonada merged 1 commit intotarantool:release/2.11from
grafin:backport/release/2.11/10952

Conversation

@grafin
Copy link
Member

@grafin grafin commented Feb 12, 2025

(This PR is a backport of #10952 to release/2.11 to a future 2.11.6 release.)


Before this patch, when log format was set to 'json' and log entry was written with format-string API (require('log').info(<format string>, args...)), in the output the message was truncated to 1024 bytes.

This patch fixes this behavior, and now the message will only be truncated if the full log entry (with all the context) doesn't fit into the 16KiB buffer. The message will be truncated in a way, so all the context is present.

Closes #10918

NO_DOC=bugfix

Before this patch, when log format was set to 'json' and log entry was
written with format-string API (`require('log').info(<format string>,
args...)`), in the output the message was truncated to 1024 bytes.

This patch fixes this behavior, and now the message will only be
truncated if the full log entry (with all the context) doesn't fit into
the 16KiB buffer. The message will be truncated in a way, so all the
context is present.

Closes tarantool#10918

NO_DOC=bugfix

(cherry picked from commit 6b891b4)
@grafin grafin added the full-ci Enables all tests for a pull request label Feb 12, 2025
@grafin grafin requested a review from a team as a code owner February 12, 2025 20:08
@grafin grafin changed the title log: fix message being truncated to 1024 bytes [backport 2.11] log: fix truncating log message to 1024 bytes in 'json' log Feb 12, 2025
@Totktonada Totktonada removed the request for review from a team February 12, 2025 20:13
@Totktonada Totktonada merged commit 8a87161 into tarantool:release/2.11 Feb 12, 2025
95 of 150 checks passed
@Totktonada Totktonada removed their assignment Feb 12, 2025
@coveralls
Copy link

Coverage Status

coverage: 85.995%. first build
when pulling b72850b on grafin:backport/release/2.11/10952
into 74fa9f0
on tarantool:release/2.11
.

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

Labels

full-ci Enables all tests for a pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants