ExAtlas.Fly.Logs.LogEntry (ExAtlas v0.5.0)

Copy Markdown View Source

A single parsed log line from the Fly Machines log API.

The raw Fly API payload is deeply nested; this struct flattens it into a simple shape that's easy to render and filter.

Summary

Functions

Builds a LogEntry from a decoded Fly log JSON object.

Types

t()

@type t() :: %ExAtlas.Fly.Logs.LogEntry{
  app_name: String.t() | nil,
  instance: String.t() | nil,
  level: String.t() | nil,
  message: String.t() | nil,
  region: String.t() | nil,
  timestamp: String.t() | nil
}

Functions

from_json(json)

@spec from_json(map()) :: t()

Builds a LogEntry from a decoded Fly log JSON object.

Expected input shape:

%{
  "timestamp" => "2024-01-01T00:00:00Z",
  "fly" => %{
    "app" => %{"instance" => "abc123", "name" => "myapp"},
    "region" => "cdg"
  },
  "log" => %{"level" => "info"},
  "message" => "Hello world"
}