Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vdk-structlog: incorporate vdk-core built-in logging plugin into vdk-structlog #2939

Closed

Conversation

yonitoo
Copy link
Contributor

@yonitoo yonitoo commented Nov 24, 2023

What:
Incorporate vdk-core built-in logging plugin into vdk-structlog by moving the logging configuration and relevant tests.

Introduced the vdk-core changes (warning and keeping the vdk-core functionality behind a flag which is activated upon the vdk-structlog installation) as part of the PR #2944.

Why: To avoid reconfiguring the logging config, thus losing information, by vdk-structlog but instead just configure it once.

Testing Done: Existing tests pass and the introduced tests from vdk-core logging are passing.

Logging format screenshots:

  • JSON:
JSON logging format
  • Console:
Console logging format

Signed-off-by: Yoan Salambashev [email protected]

@hookimpl
def vdk_initialize(self, context: CoreContext):
# Use this plugin for logging config and warn the user about the vdk-core logging deprecation
os.environ["VDK_USE_STRUCTLOG"] = "1"
configure_initial_logging()
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please post log outputs of jobs using all formats, e.g. one for json, one fore console, one for ltsv?

I have a hunch that this might mess up parts of the initial log. But I also see we still eject the formatter later on, so not sure. It would be nice to see the full output.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added 1 for JSON and 1 for console to the PR description.

Copy link
Contributor

@DeltaMichael DeltaMichael Nov 28, 2023

Choose a reason for hiding this comment

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

Can you show the whole output in something like pastebin? My concern is that it won't be formatted as JSON top to bottom, or it will have metadata that we didn't want.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@yonitoo yonitoo requested a review from DeltaMichael November 28, 2023 14:08
Copy link
Contributor

@DeltaMichael DeltaMichael left a comment

Choose a reason for hiding this comment

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

We should have further discussion around this. I really messed up the task definition. 😕

yonitoo added a commit that referenced this pull request Nov 30, 2023
…lugin is used (#2944)

What: This is part of #2813 which is addressed by #2939. Add logging
plugin warning and check if the vdk-structlog plugin is used by checking
the dedicated env var VDK_USE_STRUCTLOG.

Why: To notify the user about the logging configuration changes and to
guide them to use vdk-structlog instead.

Signed-off-by: Yoan Salambashev <[email protected]>
@DeltaMichael
Copy link
Contributor

DeltaMichael commented Jan 16, 2024

Issue was resolved here. #2985

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.

4 participants