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.
# 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.
$ 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
$ 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.
$ 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.
$ 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:
$ aws logs tail /aws/lambda/test --follow > aws.log
In another terminal window, you can read that file.
$ 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.
$ gcloud alpha logging tail "severity>=ERROR" | logdy
Make sure you have required tools installed. See tail
documentation
Learn more
Here are a few blog posts that show case a magnitude of Logdy applications: