Unexpected behaviur when trying to extract logs from log storage #1552
Labels
api: logging
Issues related to the googleapis/nodejs-logging API.
priority: p2
Moderately-important priority. Fix may not be included in next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Environment details
@google-cloud/logging
version:11.2.0Steps to reproduce
In this issue i specify the line of codes that need to be modified to fix the issue.
This scripts returns entries both for the project logs, and the current project. This is unexpected behavior, as expected behavior would be only to return logs specified by the call to getEntriesStream(). This makes it so you cant access only the logs for a concrete view without a lot of noise from the default bucket. In the code, we can see that the project default bucket is added to the query without your input, regardless you want it or not. It should be conditional, if resourceNames is provided, do not add the the default logs.
Error in getEntries:
https://github.com/googleapis/nodejs-logging/blob/9d1d480406c4d1526c8a7fafd9b18379c0c7fcea/src/index.ts#L593C18-L598C6
Error in getEntriesStream:
https://github.com/googleapis/nodejs-logging/blob/9d1d480406c4d1526c8a7fafd9b18379c0c7fcea/src/index.ts#L694C2-L695C66
Thanks!
The text was updated successfully, but these errors were encountered: