Skip to content

Quick Start

Get from zero to a log line in the browser console. Assumes an existing Angular 22 application using standalone APIs.

  • Angular 22.x (Lumberjack 22 requires @angular/core ^22). See Compatibility for other lines.
pnpm add @ngworker/lumberjack
  1. Register Lumberjack and the console driver

    import { bootstrapApplication } from '@angular/platform-browser';
    import { provideLumberjack } from '@ngworker/lumberjack';
    import { provideLumberjackConsoleDriver } from '@ngworker/lumberjack/console-driver';
    
    import { AppComponent } from './app/app.component';
    
    bootstrapApplication(AppComponent, {
      providers: [provideLumberjack(), provideLumberjackConsoleDriver()],
    });
  2. Emit a log

    import { Component, inject, OnInit } from '@angular/core';
    import { LumberjackService } from '@ngworker/lumberjack';
    
    @Component({
      selector: 'app-root',
      template: `<h1>Forest</h1>`,
    })
    export class AppComponent implements OnInit {
      readonly #lumberjack = inject(LumberjackService);
    
      ngOnInit(): void {
        this.#lumberjack.logInfo('Hello, Forest!');
      }
    }

Start the app and open the browser console. You should see a formatted info line such as info 2026-07-24T12:00:00.000Z Hello, Forest!.