-
Notifications
You must be signed in to change notification settings - Fork 55
Multiple issues while changing the timestamp of a log #542
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
Comments
Hey @simranchanna , could you give a code snippet so I can see how you're calling the library, how you're formatting the timestamp, and how you're viewing the logs? I just tried to reproduce this, but it seems to be working for me:
I noticed the log doesn't appear in the Log Explorer until the time denoted in the timestamp, so that may be why it appears that no log is created. But let me know if you're seeing something different |
Hey @daniel-sanche, I tried a little modified version of your code:
I tried to see the sent logs in Logs Explorer and in the given log but didn't see any. I am in CET timezone and the Logs Explorer is set to this timezone as well. |
Nothing you're doing stands out as wrong to me. To help debug: can you show me what filters you're using in log explorer and what GCP environment you're running the code on? Do you see any logs if you omit the |
Yeah I saw logs when I omitted the timestamp field. |
Ok great, glad you got it working |
I've tried several methods to change the timestamp of a log being sent to cloud logging, but there are a few problems:
I'm able to send data only in the past and not in the future while using API directly - (whereas according to the documentation https://cloud.google.com/logging/docs/reference/v2/rest/v2/entries/write the timestamp value can be maximum 24 hours in the future)
I'm passing the timestamp value while calling the struct_log method and that timestamp is passed internally in the library functions to where API is called, but that doesn't work at all and as a result, no log is created.
The text was updated successfully, but these errors were encountered: