Development

Real Time Logging with the Tail Command

By Nick Schuch27th August 2024

Overview

Developers need tooling that enables fast feedback loops when debugging application issues.

They need to be able to execute a set of steps and see the results in real time. Anything less leads to lots of waiting and less time spent debugging to get to the root cause.

One tool to solve this problem recently shipped in Skpr v0.29.0.

This feature is called Real Time Logging and is implemented as the "tail" command on the Skpr Command Line Interface (CLI).

Video

In this video I will take you through:

  • Skpr's logging solutions
  • What is the the debug feedback loop?
  • How does Real Time Logging work?
  • A demo of how you can use the tail command

Logging Options

Skpr provides a full suite of logging solutions for development teams.

  • Dashboards - A curated experience for reviewing errors, warnings and cron logging events.
  • Insights - A console for executing queries across large data sets of logs.
  • Tail - Our latest feature for debugging applications live.

The Debug Feedback Loop

We had a very important reason for implementing our tail command. That reason was “The Debug Feedback Loop”.

Dashboards and Insights rely on infrastructure tooling which batch and send logs at intervals (typically every 60 seconds).

When debugging an issue live (form submission failure), we need to be able to perform that action (e.g. submit a form) and see the result in real time to be able to understand the interactions currently taking place in our applications. We then take that information and start performing more actions until we finally understand the root cause. We want this loop to go fast (just like our applications).

Anything less than real time is unacceptable.

How does it work?

Skpr is built on top of Kubernetes, a container native platform for managing applications.

One feature of Kubernetes is its APIs for streaming logging data.

Skpr’s API coordinates these API calls across multiple instances of your application (e.g. three instances or in Kubernetes terms, Pods).

We then expose a number of streams that developers can tail using our API and command line tooling.

What can I stream from the tail command?

You can stream every log in your application stack.

If you have deployed Drupal then you can stream Nginx and FPM logs.

If you have deployed Node or Go applications then you can stream Web and App logs.

But not only that...

You can also stream Daemons!

Daemons are a feature that we recently shipped in v0.28.0.

This feature allows developers to deploy long running background tasks, which supplement the primary running application.

Examples of this include:

  • Cache invalidators
  • Email processors
  • PDF generation

All these tasks print logs. Logs that need to be seen when debugging an application live.

How do I use the tail command?

The tail command can be executed in the following ways:

# Tail logs for production using the default stream.
$ skpr logs tail prod

# Discover the streams that you can tail for production.
$ skpr logs list prod

# Tail multiple streams for production.
$ skpr logs tail prod nginx fpm

Conclusion

Real Time Logging continues our efforts to bolster how developers can debug applications on Skpr.

If you have any questions or would like a demo, please contact the Skpr team.

Tags

announcement
logging
debugging

Getting Started

Interested in a demo?

🎉 Awesome!

Please check your inbox for a confirmation email. It might take a minute or so.

🤔 Whoops!

Something went wrong. Check that you have entered a valid email and try submitting the form again.

We'll be in touch shortly.