Skip to content

Logger.pretty drops first argument in Cloudflare Workers #5398

@schickling

Description

@schickling

Bug Report

Description

When using Effect.log() with Logger.pretty in Cloudflare Workers, the first argument is consistently missing from the log output. Single-argument log calls produce no output at all.

Environment

  • Effect Version: 3.17.7
  • Runtime: Cloudflare Workers (Wrangler 3.114.13)
  • Logger: Logger.pretty

Expected Behavior

All arguments passed to Effect.log() should be logged:

Effect.log("First", "second", "third") // Should show: "First second third"
Effect.log("Single test") // Should show: "Single test"

Actual Behavior

First argument is missing, single arguments disappear:

Effect.log("First", "second", "third") // Shows: "second third"
Effect.log("Single test") // Shows: (nothing)

Reproduction

Repository: https://github.com/schickling-repros/2025-08-effect-pretty-logger-cloudflare

Steps:

  1. Clone the reproduction repo
  2. Run pnpm install && pnpm dev
  3. Execute curl http://localhost:8787
  4. Observe missing first arguments in console

Comparison with Default Logger

The default logger works correctly and shows all arguments as separate message= fields:

timestamp=2025-08-18T13:43:37.844Z level=INFO fiber=#0 message="First argument" message="second argument" message="third argument"

Impact

  • Silent data loss in logging output
  • Debugging difficulties as primary context is often the first argument
  • Single-argument logs completely disappear

Code Sample

import { Effect, Logger } from "effect"

const program = Effect.gen(function* () {
  yield* Effect.log("Context:", "important", "data") // Only shows "important data"
  yield* Effect.log("Debug info") // Shows nothing
})

await Effect.runPromise(
  program.pipe(Effect.provide(Logger.pretty))
)

This appears to be specific to the Cloudflare Workers environment, as the bug doesn't occur with the default structured logger.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions