Skip to content

Add support for structured logging#212

Merged
mxpv merged 2 commits intocontainerd:mainfrom
jsturtevant:support-structured-logging
Oct 11, 2023
Merged

Add support for structured logging#212
mxpv merged 2 commits intocontainerd:mainfrom
jsturtevant:support-structured-logging

Conversation

@jsturtevant
Copy link
Copy Markdown
Contributor

This is a follow up to #210.

Example usage would be:

log::info!(target: "wasmtime", key1 = "test it"; "setting up wasi!!");

with the output

time="2023-10-06T21:49:05.767158934Z" level=info msg="calling start function"
time="2023-10-06T21:49:05.767242837Z" level=info key1="test it" msg="setting up wasi!!"
time="2023-10-06T21:49:05.767259938Z" level=info msg="waiting for instance: testwasm"

Question: Should this be behind a feature flag? The functionality is in log crate behind kv_unstable. The major issue would be that the api might change but it is pretty small api that is being used here and it is being used in projects like https://github.com/iorust/structured-logger

@github-actions github-actions Bot added C-shim Containerd shim T-CI Changes in project's CI labels Oct 6, 2023
@jsturtevant jsturtevant force-pushed the support-structured-logging branch from 9ee3d0d to 66cfa81 Compare October 6, 2023 22:08
@jsturtevant jsturtevant force-pushed the support-structured-logging branch from 28fa683 to 8a41a79 Compare October 6, 2023 22:33
Copy link
Copy Markdown
Member

@Burning1020 Burning1020 left a comment

Choose a reason for hiding this comment

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

lgtm

Comment thread crates/shim/src/logger.rs Outdated
@github-actions github-actions Bot added C-runc-shim Runc shim C-runc runc helper labels Oct 9, 2023
@jsturtevant jsturtevant force-pushed the support-structured-logging branch from 4dae8ff to ca8cf56 Compare October 9, 2023 17:28
@github-actions github-actions Bot removed C-runc-shim Runc shim C-runc runc helper labels Oct 9, 2023
Signed-off-by: James Sturtevant <jstur@microsoft.com>
Signed-off-by: James Sturtevant <jstur@microsoft.com>
@jsturtevant jsturtevant force-pushed the support-structured-logging branch from ca8cf56 to 8a83b38 Compare October 9, 2023 17:30
@mxpv mxpv added this pull request to the merge queue Oct 11, 2023
Merged via the queue into containerd:main with commit e31b3c6 Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-shim Containerd shim T-CI Changes in project's CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants