When logging errors, I am not aware of a method to add the IP address and similar info to the logged data. Specifically, I'm looking to set the base properties of GCP HTTP request log entries.
The question is, is there a straightforward method to do this? Or does it require diving into the tracing extensions?
Variables available when throwing the exception:
Variables available when handling the exception in the log handler:
How the project's loggers are set up:
log_gcp_handler = {
"class": "google.cloud.logging.handlers.StructuredLogHandler",
"labels": {"process": django_process},
"project_id": gcs_project_id,
}
...
"loggers": {
"": {
"handlers": ["log_gcp_handler"],
"level": log_level,
"propagate": False,
},
"django.channels.server": {
"handlers": ["log_gcp_handler"],
"level": "WARNING",
"propagate": False,
},
"django.request": {
"handlers": ["log_gcp_handler"],
"level": "ERROR",
"propagate": False,
},
"strawberry.execution": {
"handlers": ["log_gcp_handler"],
"level": log_level,
"propagate": False,
},
},
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too