๐Ÿšข
๐Ÿšข Deploying & Running Your App ยท DEPLOY-101 ยท Session 4 of 5

Keeping It Running: Logs & Reliability

Deploying isn't the finish line โ€” a live app has to *stay* healthy. Logging, monitoring, and building in resilience are what keep your service running when the real world gets messy.

โฑ 9 min read๐Ÿ“… Updated 2026-08-04๐Ÿ“Š Tables, charts & examples

Going live is a milestone, not the end. A running app faces the messy real world: traffic spikes, flaky networks, unexpected input, things that break at 3am while you're asleep. Keeping a service healthy means being able to see what it's doing (logging), know when it's unhappy (monitoring), and survive trouble gracefully (resilience). These are the operational skills that keep real software running - and the stack has tools for each.

๐Ÿ“Œ Worked example
The 3am outage you slept through - and fixed by 9am. A live app's payment provider had a brief outage overnight, and a handful of checkouts failed. The developer was asleep - but the app was built to cope: it retried the transient failures (most succeeded on the second try), a circuit breaker stopped hammering the provider while it was fully down, and every failure was logged with context. In the morning, the developer opened the structured logs, searched for the errors, saw exactly what happened and which users were affected, and confirmed the retries had recovered most of them - all before the first coffee. Without logging and resilience, that same night would have meant silent lost sales, angry users, and a blind, panicked morning of guesswork. Operating real software is about expecting the messy real world and being ready to see and survive it.

Logs: your eyes on a running app

When your app runs on a server you can't watch, logs are how you know what happened. Good logging is the single most valuable operational habit.

from larzlog import Logger
log = Logger("api", level="INFO", json=True)

log.info("request handled", path="/users/42", ms=48)
log.error("payment failed", user_id=42, reason="card_declined")
๐ŸŽฏ
Log what happens, so you can understand problems you didn't witness. A user reports 'it broke' - with good logs, you look and see exactly what happened: the request, the values, the error. Without them, you're blind. Log important events and errors with useful context (who, what, why), at sensible levels (info for normal, error for problems). Structured logs (like larzlog's JSON) are searchable, so you can find 'all errors for user 42' instantly. Logging turns mysterious production issues into readable stories.

Monitor and build in resilience

Beyond logs, you want to know when something's wrong (monitoring) and design your app to cope with the inevitable failures (resilience).

ConcernHow to handle it
Is it up right now?Monitoring / uptime checks that alert you
A dependency is flakyRetry with backoff (larzretry)
A service is downCircuit breaker - fail fast, don't pile on
Traffic spike / abuseRate limiting (larzratelimit)

The real world is unreliable, so robust apps expect failure: they retry transient errors, stop hammering a dependency that's clearly down (a circuit breaker), and protect themselves from overload with rate limits. Monitoring alerts you to problems - ideally before users notice. Building in this resilience is what separates an app that survives a bad day from one that falls over.

Run it like a real service

  • Logs are your eyes - log important events and errors with context, at sensible levels (larzlog).
  • Monitoring tells you when the app is down or unhappy, ideally before users do.
  • Resilience - retry flaky calls, circuit-break dead ones (larzretry), rate-limit abuse (larzratelimit).
  • Expect failure - robust apps are built to cope, not to assume everything works.

๐Ÿงฉ Do it with LarzOS

Turn this lesson into action with the exact free tools and AI workflows for the job:

๐ŸŽฏ Key takeaways

  • Going live is a milestone, not the end - a running app must stay healthy in a messy real world.
  • Logs are your eyes on a server you can't watch: log important events and errors with context (larzlog).
  • Monitoring tells you when something's wrong, ideally before users notice.
  • Build in resilience - retry transient failures, circuit-break dead dependencies (larzretry), rate-limit abuse (larzratelimit).

Frequently asked

What should I actually log, and what's the difference between the log levels?

Log the things that will help you understand what your app did and diagnose problems when you can't watch it live - meaningful events and errors, with enough context to be useful - and use levels to indicate how important or severe each message is so you can filter. On what to log: record significant events (a user signed up, a payment was processed, a job completed), errors and failures (with details of what went wrong and the relevant context like which user, which input, what the error was), and important state changes or decisions your app makes. Include context that would help future-you diagnose an issue: relevant ids, key values, and what was happening - so that when something goes wrong you can reconstruct the story. Avoid logging too much noise (every trivial step) because it drowns the useful signal and can be costly, and never log sensitive data like passwords, full payment details, or secrets (that's both a security risk and often a legal one). On levels, the common ones from least to most severe are: DEBUG (detailed information useful while developing or diagnosing, usually turned off in production because it's verbose); INFO (normal, noteworthy events - the app working as expected, like 'request handled' or 'user created'); WARNING (something unexpected or concerning that didn't break things but might need attention - a recoverable issue, a deprecated path, an odd but handled situation); ERROR (something failed - an operation didn't complete, an exception occurred - that needs looking at); and CRITICAL (severe failures that may mean the app or a major feature is broken and needs urgent attention). Levels are valuable because they let you filter: in production you might show INFO and above (skipping the noisy DEBUG), and when hunting a problem you can focus on just ERROR and above to see what's failing, or search structured logs for all errors affecting a particular user. The practical habit is to log normal significant events at INFO, problems at ERROR (with good context), genuinely severe breakage at CRITICAL, concerning-but-handled things at WARNING, and detailed diagnostic info at DEBUG (which you can enable when investigating). Structured logging (key=value or JSON, as larzlog provides) makes all of this searchable, so you can quickly find exactly the events you care about. Good logging is one of the highest-value operational habits precisely because it turns invisible production behaviour into a readable, searchable record you can consult when something goes wrong - which, in a live app, it eventually will.

Isn't building in retries, circuit breakers and rate limits overkill for a small app?

For a genuinely tiny personal app with a handful of users, some of it can wait - but the underlying mindset of expecting failure is worth having from the start, and the specific tools matter as soon as your app touches unreliable things or real users, which happens sooner than you'd expect. Here's how to think about proportionality. Retries are valuable almost immediately if your app calls anything over a network - other services, APIs, sometimes databases - because networks and external services fail transiently all the time (a brief blip, a momentary timeout), and a simple retry turns many of those transient failures into successes the user never even notices; skipping retries means occasional avoidable failures. So if your small app makes external calls, basic retry logic is low-effort, high-value, not overkill. Circuit breakers matter more as you depend on external services that can go fully down: without one, if a service you call becomes unavailable, your app might keep trying and waiting on every request, piling up and becoming slow or unresponsive itself - a circuit breaker makes it fail fast instead, staying responsive. This is more of a concern as your app grows and its dependencies multiply, so it's reasonable to add when you have a dependency whose outage would drag your app down, rather than on day one of a trivial project. Rate limiting becomes important once your app is public and could face traffic bursts, abuse, or the risk of blowing through a paid API's quota - protecting yourself from being overwhelmed or hit with a huge bill. For a private tool only you use, it's unnecessary; for a public app or an API others can call, it's prudent. So the honest answer is that these aren't all mandatory for the smallest apps, and adding every reliability pattern to a trivial project would be over-engineering. But the mindset behind them - that the real world is unreliable and robust apps expect and cope with failure rather than assuming everything works - is a valuable perspective to hold throughout, and the specific tools each earn their place at recognisable moments: retries when you make network calls, circuit breakers when a dependency's outage would harm you, rate limits when you're public or protecting a quota. The good news is that with tools like larzretry and larzratelimit, adding these when needed is straightforward rather than a big project, so you can start simple and layer in resilience as your app faces the conditions that call for it. Match the resilience to the app's real exposure to failure and load: don't gold-plate a toy, but do build in the patterns that fit as your app becomes something real people rely on. Expecting failure is the durable lesson; applying each specific safeguard is a matter of proportion.

Session 4 of 5 complete

Next up: Ship with Confidence: The Release Habit

Continue to Session 5 โ†’

Related lessons

More in this course

Course home → · Browse all courses →