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

Update additional fields to be logged for debug logging #761

Open
ohmayr opened this issue Nov 25, 2024 · 2 comments
Open

Update additional fields to be logged for debug logging #761

ohmayr opened this issue Nov 25, 2024 · 2 comments
Assignees

Comments

@ohmayr
Copy link
Contributor

ohmayr commented Nov 25, 2024

Update _recognized_logging_fields to include any additional fields that need to be logged.

@vchudnov-g
Copy link
Contributor

We can add "line_number": record.lineno and other helpful information (eg method name) from https://docs.python.org/3/library/logging.html#logrecord-objects

@vchudnov-g
Copy link
Contributor

Suggested format:

"logging.googleapis.com/sourceLocation": {
  "line": 2155, 
  "file": "/usr/local/......./git/python-aiplatform/google/cloud/aiplatform_v1/services/prediction_service/client.py", 
  "function": "generate_content"
}

Question: do we want to include the full path to the file, or elide everything before the google package? Probably the full path is most helpful, but could there be unexpected consequences (like logs being substantially longer, or revealing somewhat detailed info about the directory structure that might pose a security risk)? One mitigation possibility (addressing mostly the size issue) might be to emit the root path to the "google" package once when we set up logging, and having our default handler just output paths rooted at at that "google" package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants