-
Notifications
You must be signed in to change notification settings - Fork 663
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
how to get "body" to use what's specified in logging setformatters? #3353
Comments
I guess the problem is in opentelemetry-python/opentelemetry-sdk/src/opentelemetry/sdk/_logs/_internal/__init__.py Line 474 in 6b9f389
body=record.getMessage() . So, it is completely ignoring any formatters that has been configured.
so a possible fix would be to change https://github.com/open-telemetry/opentelemetry-python/blob/6b9f389940ec0123d5dafc7cb400fc23c6f691c6/opentelemetry-sdk/src/opentelemetry/sdk/_logs/_internal/__init__.py#LL497C9-L497C51 to:
For those who can't wait for the update, you can easily create a new class and use it instead of
|
small update, since I don't use args, this code:
should be changed to:
or you will hit this error:
|
@jesumyip thanks for reporting this, would you mind submitting a PR? |
I believe this pr would address this issue |
Closing due to inactivity. |
Using these python modules:
I have the following code snippet:
I have the following env vars set:
Whenever I do something like logging.info("Hi there, Mr. Pineapple!"), I see that the output JSON has something that looks like this:
I am expecting "body" to have the format dictated by OTEL_PYTHON_LOG_FORMAT, but it does not. How can I get "body" to also contain for example lineno, pathname, etc? @srikanthccv
The text was updated successfully, but these errors were encountered: