INVALID_ARGUMENT: Log entry with size NK exceeds maximum size of YK
The error message "INVALID_ARGUMENT: Log entry with size 789.3K exceeds maximum size of 256.0K" indicates that you are trying to log an entry that exceeds the maximum allowed size for a log entry in Google Cloud Logging.
In Google Cloud Logging, each log entry has a size limit, and the default maximum size is 256 KB. If you attempt to log an entry that surpasses this limit, you will encounter the "INVALID_ARGUMENT" error you mentioned.
To resolve this issue, you should truncate the object that you are passing to the GCP Log
Change in your code:
Add truncateObject() like this:
Here are the full codes
Conclusion:
Adjust the code according to your specific logging setup and language environment. The key is to ensure that your log entries are within the allowed size limits.Related Keywords:
INVALID_ARGUMENT: Log entry with size NK exceeds maximum size of YK
INVALID_ARGUMENT: Log entry with size, exceeds maximum size
GCP Logging: Exception is thrown when log entries > 256kb
Support our IDKBlogs team
Creating quality content takes time and resources, and we are committed to providing value to our
readers.
If you find my articles helpful or informative, please consider supporting us financially.
Any amount (10, 20, 50, 100, ....), no matter how small, will help us continue to produce
high-quality content.
Thank you for your support!
Thank you
I appreciate you taking the time to read this article. The more that you read, the more things you will know. The more that you learn, the more places you'll go.
If you’re interested in Node.js or JavaScript this link will help you a lot.
If you found this article is helpful, then please share this article's link to your friends to whom this is required, you can share this to your technical social media groups also.
You can follow us on our social media page for more updates and latest article updates.
To read more about the technologies, Please
subscribe us, You'll get the monthly newsletter having all the published
article of the last month.