Learning resourcesReviewed · E2B

E2B Template Build Logging Guide

E2B’s Logging page is an SDK guide for developers who need template-build logs, but it assumes an existing template and SDK setup. It explains default log filtering, custom callbacks, structured log entries and debug-level build start/end markers in JavaScript/TypeScript and Python.

Researched 15 Nov 2026

In short.

E2B’s Logging guide is a practical reference for JavaScript, TypeScript and Python developers adding template-build logging, but it does not explain SDK installation or template creation. It shows how to filter output with a default logger or process structured entries with custom callbacks. Build start/end entries default to debug, below the example’s info threshold; the page does not say whether the default logger shows or handles them specially, so their visibility is unverified. No examples were executed; version compatibility, costs and log-retention behavior are unknown.

Researched and written by an AI model and checked by a second AI model. How it works

Covers the complete selected Logging page at [https://docs.e2b.dev/template/logging.md], including default logging, custom callbacks, structured entry fields and build start/end types. The introductory index link at [https://docs.e2b.dev/llms.txt] and all linked pages are excluded. Installation, authentication, template creation, pricing, licensing and operational guarantees are not established by this page. No code was executed and no runtime behavior was tested.

The overview

Identity

The resource is E2B’s documentation page titled Logging at [https://docs.e2b.dev/template/logging.md]. It teaches how to receive and display template-build logs through the e2b SDK in JavaScript/TypeScript and Python. Its documented scope is build logging; it does not explain logs from applications running inside a sandbox.

Assessment

This is useful when an existing template-build integration needs readable output, severity filtering or special handling of build boundaries. The examples connect configuration options to log-entry fields and types, giving developers enough detail to adapt a callback.

It is a focused reference rather than a complete getting-started guide: the template object already exists in its examples, and installation, authentication and SDK versions are unspecified. Runtime correctness and reliability were not assessed.

Users

The intended readers are developers building E2B templates with JavaScript/TypeScript or Python. Beginners can start with the default logger without writing their own output handler. Custom logging requires understanding a callback: a function that receives a log entry so the application can decide how to display or handle it.

Experienced developers can use the timestamp, severity and message fields for consistent formatting, or distinguish start/end entry types when integrating build progress into existing code.

Capabilities

The default logger accepts a minimum severity through minLevel in JavaScript/TypeScript or min_level in Python. Both examples select info.

Custom callbacks can print an entry’s formatted representation, construct output from its timestamp, level and message, or display only warn and error entries. The JavaScript example sends those entries to console.error; the Python example sends them to standard error.

LogEntryStart and LogEntryEnd distinguish the beginning and end of a build. Both default to debug severity.

Using it

Requirements

The examples require the e2b SDK, a prepared template object and code that calls Template.build. JavaScript/TypeScript uses await, so its example needs an execution context that supports it. Python’s standard-error example also requires importing sys before using sys.stderr.

The page does not specify installation commands, credentials, supported language versions or a minimum SDK version. It also does not show imports for the start/end entry types used in its type-checking examples.

Mechanism

Template.build accepts an onBuildLogs callback in JavaScript/TypeScript or on_build_logs in Python. The callback receives structured LogEntry objects rather than only plain text.

Each entry has a timestamp, a level drawn from debug, info, warn and error, and a message. JavaScript represents the timestamp as Date and provides toString(); Python uses datetime and a string representation method. Start/end entries extend the base entry type and can be recognized with instanceof or isinstance.

Setup

For the documented default configuration, import Template and defaultBuildLogger from e2b in JavaScript/TypeScript, then pass defaultBuildLogger({ minLevel: "info" }) as onBuildLogs in the Template.build options. Python imports Template and default_build_logger, then passes default_build_logger(min_level="info") through on_build_logs.

To customize output, replace the default logger with a function that handles the received entry. A working template and the broader SDK setup must be supplied separately.

Example

For a build script that should show only warnings and errors, the documented custom callback checks whether the entry’s level equals warn or error. JavaScript prints the entry’s formatted representation using console.error(logEntry.toString()); Python prints the entry prefixed with "ERROR/WARNING: " using print with file=sys.stderr.

For timestamped output, the examples convert the timestamp to an ISO-format string and combine it with the uppercase level and message. These are documented usage patterns; no build was run and no resulting output is available.

Assessment & evidence

Limitations

Because start/end entries use debug severity, below the default logger example’s info threshold, they may be filtered out; the page does not document how the default logger treats these entry types. The custom callback examples receive entries directly and can check for them with instanceof or isinstance.

The page does not define log persistence, historical retrieval, ordering, delivery guarantees or callback-error handling. It describes LogEntryEnd as marking the build’s end, but does not establish whether that marker indicates success or how failed builds are represented.

Reasoning

The documented options suggest starting with the default logger when severity filtering and ordinary output are sufficient. A custom callback is appropriate when the application needs its own formatting, output destination or handling of start/end types.

That recommendation follows from the examples’ configuration choices. The page provides no measurements of performance, overhead or reliability that would support stronger comparisons.

Alternatives

The alternatives demonstrated on the page are the default logger, a callback that prints every received entry, a callback with custom formatting and a callback restricted to warnings and errors. JavaScript/TypeScript and Python examples cover the same broad approaches.

No external logging libraries, monitoring services or competing build systems are compared, so their suitability cannot be assessed from this page.

Evidence

The evidence is the complete Logging documentation page at [https://docs.e2b.dev/template/logging.md]. It supplies SDK call examples, callback examples and definitions of the log-entry fields and start/end types.

The page contains no recorded build output, benchmark results or compatibility matrix. Nothing was executed, so the examples establish documented usage rather than demonstrated runtime behavior.

Access & freshness

Costs

The page provides no pricing, allowances or billing information. Charges for E2B template builds, log handling or any associated storage are unknown. The presence of SDK examples does not establish that the underlying service is free.

Rights

The supplied page contains no licence or explicit redistribution terms for its text or code examples. Permissions for copying or redistributing them are unknown. The SDK’s licence and the service’s usage terms are also not established here.

Freshness

The supplied page snapshot was captured on 15 November 2026 at 10:34:45.276 UTC. The page itself supplies no publication date, update date or SDK version. Its compatibility with a particular installed release, and any changes after capture, are unknown.

Actions

Confirm that the installed e2b SDK supports the documented callback names, then add the default logger to an existing template build. Choose a custom callback when its formatting or warning/error filtering matches the application’s needs.

If build boundaries matter, verify that debug entries remain visible and check how successful and failed builds behave in the intended environment. Confirm current pricing and applicable reuse terms separately; neither is supplied here.

Evidence for this report

selected-page.txtselected · checked 2026-11-15