GCP – Find logs fast with new “tail -f” functionality in Cloud Logging
When you’re troubleshooting an app or a deployment, every second counts! Cloud Logging helps you troubleshoot by aggregating logs from across Google Cloud, on-premises or other clouds, indexing, aggregating logs into metrics, scanning for unique errors with Error Reporting and making logs available for search, all in less than a minute. And now, we’ve built two new features for streaming logs to give you even fresher insights from your logs data.
By popular demand from Linux users, we added a new tool to mimic the behavior of the tail -f
command, which allows you to display the contents of a log file to the console in real time. We’ve also included upgrades beyond the well-loved tail tool such as searching across all logs from all your resources at once and the ability to use Cloud Logging’s powerful logging query language including global search, regular expressions, substring matches, etc., all still in real-time.
You can use the logging query language with the new live feature to find information in your logs in real-time. For example, let’s say you just deployed a new application and want to look at all error logs:
gcloud alpha logging tail "severity>=ERROR"
But this returns too many results so you narrow the scope to just logs that include the text “currency”:
gcloud alpha logging tail "severity>=ERROR AND currency"
This search returns a meaningful set of logs, all still in real time.
Tailing logs with gcloud is now available to all users in Preview. Head over to our docs to get it set up and start tailing.
And if you prefer using Google Cloud Console, we’ve got great news for you as well. You can now stream logs to Logs Explorer as well as easily stream, pause, explore, link to traces, resume streaming, visualize counts and download logs, all from the Cloud Console.
So whether you prefer command line tail -f or a dedicated user experience for exploring logs, check out Cloud Logging’s new tools and save time troubleshooting.
Read More for the details.