Skip to main content
You can retrieve the build logs using the SDK.

SDK

The onBuildLogs/on_build_logs callback receives structured LogEntry objects with the following properties:
type LogEntry = {
  timestamp: Date
  level: 'debug' | 'info' | 'warn' | 'error'
  message: string
  toString(): string // Returns formatted log string
}
You can customize how logs are handled:
// Simple logging
onBuildLogs: (logEntry) => console.log(logEntry.toString());

// Custom formatting
onBuildLogs: (logEntry) => {
  const time = logEntry.timestamp.toISOString();
  console.log(`[${time}] ${logEntry.level.toUpperCase()}: ${logEntry.message}`);
};

// Filter by log level
onBuildLogs: (logEntry) => {
  if (logEntry.level === "error" || logEntry.level === "warn") {
    console.error(logEntry.toString());
  }
};