I encountered an issue in the Google Cloud Log Explorer where certain error logs were not being categorized correctly. Specifically, I had repeated ReferenceError: reservations is not defined errors that were logged as "Info" rather than "Error."
These errors originated from a JavaScript function triggered by document events uploaded via Firebase. I’ve already resolved the error itself, so it’s no longer occurring, but I noticed the misclassification while reviewing past logs. Both the Severity menu on the left and the top timeline menu display these logs as general information instead of error logs, which caused me to miss them for hours during monitoring.
This is the first time I’ve seen this kind of misclassification, and it seems specific to this case. Could you help me understand why this happened and if there’s a possibility of similar issues occurring in the future? Any guidance on preventing this kind of misclassification would also be appreciated.
Hi @yongeun,
Welcome to Google Cloud Community!
It's great you've identified the issue and resolved the underlying error in your JavaScript code.
However, the misclassification in Google Cloud Log Explorer is a separate concern, and it's important to understand why it happened. Here's a breakdown of the possible reasons:
1. The most likely culprit is that your code was logging the error at an "Info" level instead of an "Error" level. This is often a result of misconfiguration within your Firebase functions or the JavaScript code itself. Ensure you're using the appropriate logging level for your errors. For example, in Firebase functions, you can use these following codes to correctly categorize it as an error:
2. In the Log Explorer Interpretation relies on specific keywords and patterns within the log message to determine its severity. In some cases, the error message might not contain the standard keywords that the system expects for "Error" classification. Review the Log Explorer documentation to understand how it interprets log messages.
3. Possible there could be temporary issues within the Google Cloud Logging service itself that might affect the log categorization. Check the Google Cloud Status dashboard to see if there are any known outages or issues impacting logging services.
To avoid this kind of issue in the future, here are some guide and documentations you can check:
If you continue to experience log misclassification issues despite implementing these guides, please feel free to reach out to our support team.
I hope the above information is helpful.