Quick Start
Get from zero to a log line in the browser console. Assumes an existing Angular 22 application using standalone APIs.
Before you start
Section titled “Before you start”- Angular 22.x (Lumberjack 22 requires
@angular/core^22). See Compatibility for other lines.
Install
Section titled “Install”pnpm add @ngworker/lumberjack bun add @ngworker/lumberjack npm install @ngworker/lumberjack yarn add @ngworker/lumberjack -
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()], }); -
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!'); } }
Verify
Section titled “Verify”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!.
Next steps
Section titled “Next steps”- Write a logger — prefer typed logger classes over calling the service everywhere
- Configure Lumberjack — levels and format
- Send logs over HTTP — remote store