Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.edgespark.dev/llms.txt

Use this file to discover all available pages before exploring further.

EdgeSpark captures logs from your project’s worker and streams them in real time through the CLI.

Stream logs

edgespark log tail
The output includes console.info, console.warn, console.error, uncaught exceptions, and request summaries for each invocation.
edgespark log tail streams from your current default environment. For newly created projects today, that is the single public production environment.
For a quick manual check, run edgespark log tail in one terminal and trigger requests from another. For longer debugging sessions, the better pattern is to send the log stream to a file and let it keep running in the background while you deploy, trigger requests, and inspect results separately:
mkdir -p .logs
edgespark log tail > .logs/edgespark.log 2>&1 &
This works well when you want to:
  • keep logs running while you edit and redeploy
  • trigger requests from another shell or browser
  • review the stream after the fact instead of watching one long interactive session
  • let an agent keep the log stream alive in the background while it checks the file incrementally

Check the file while requests are running

Once the background stream is running, trigger a request and inspect the file:
curl -i https://my-app.edgespark.app/api/hello
For AI agents, the guidance is simple: keep edgespark log tail running in the background, write it to .logs/edgespark.log, and read that file between deploys, requests, and retries. That is more reliable than keeping the agent attached to a continuously streaming terminal session. The log file becomes a stable artifact the agent can inspect, summarize, and revisit after each step.

Log a message from your code

server/src/index.ts
import { db } from "edgespark";
import { auth } from "edgespark/http";
import { Hono } from "hono";
import { posts } from "@defs";

const app = new Hono().post("/api/posts", async (c) => {
  const body = await c.req.json<{ title: string; content?: string }>();

  console.info("Creating post", { title: body.title, userId: auth.user.id });

  try {
    const [post] = await db
      .insert(posts)
      .values({ title: body.title, content: body.content ?? null, authorId: auth.user.id })
      .returning();

    console.info("Post created", { postId: post.id });
    return c.json(post, 201);
  } catch (error) {
    console.error("Post insert failed", { userId: auth.user.id, error });
    return c.json({ error: "Failed to create post" }, 500);
  }
});

export default app;

See also

Deploy and test loop

How to read logs after a request and iterate on errors.

Development workflow

Where edgespark log tail fits in the normal edit, deploy, and validate loop.

CLI commands

Full reference for edgespark log tail and the rest of the CLI.

Handling errors

How to use runtime logs to debug deploy failures, request errors, and SQL rejections.
Last modified on April 9, 2026