Skip to content

Real-time Google Cloud functions & AWS Lambda logs viewer

With Logdy it's easy to consume any CLI output, browse it and filter it. Look at a simple example below.

bash
# use with any shell command
$ tail -f file.log | logdy

Now, knowing that Logdy can consume any CLI command output, how can we apply the very same pattern to format logs from major cloud providers in a nice, slick web UI?

Google Cloud functions real-time logs web UI viewer

Assume you have GCP CLI tool installed, use Logdy to consume GCP Cloud functions logs. Read more about logs read command.

bash
$ gcloud functions logs read <function-name> | logdy

AWS Lambda real-time logs web UI

Assume you have AWS CLI tool installed, use Logdy to consume AWS lambda logs. Read more about tail command

bash
$ aws logs tail /aws/lambda/<function-name> --follow | logdy

AWS CloudWatch real-time logs web UI viewer

In a similar fashion you can tail on any kind of logs from AWS.

bash
$ aws logs tail {log-group-name} --follow | logdy

Replace {log-group-name} with the name of the log group you want to monitor.

WARNING

Due to issues aws has with producing output to a non TTY (pipe for example) you can have problem with using the above commands. In that case read the guide below on how it can be fixed.

Alternatively, you can stream the logs from AWS in two other ways. One way assumes using script command.

bash
$ script -q /dev/null aws logs tail /aws/lambda/<function-name> --follow | logdy -v -t

The above command wraps aws logs tail {log-group-name} --follow within a script command. This solution has been built based on StackOverflow answer.

Another way is more straightforward but requires running two commands. Simply stream the output of aws logs to a file, then set up Logdy to follow that file.

Saving logs to a file:

bash
$ aws logs tail /aws/lambda/test --follow > aws.log

In another terminal window, you can read that file.

bash
$ logdy follow --full-read aws.log

The trade-off here is that, it will take two commands to run the whole operation, on the other hand, you get logs stored on a disk already.

GCP logs tailing in a web UI

Same applies to GCP, you can tail on any kind of logs coming from GCP and even reuse built-in filtering capabilities.

bash
$ gcloud alpha logging tail "severity>=ERROR" | logdy

Make sure you have required tools installed. See tail documentation

Learn more