notlogs rocket
notlogs

SDK

SDK Configuration

Configure logger parameters including API keys, application names, and environments.

Configuration Options

OptionTypeRequiredDescription
apikeystringYesYour NotLogs API key starting with SEL_
appNamestringYesIdentifies your app or service in dashboards and alerts
enviormentstringNoEnvironment name (“production”, “staging”, “development”)

Basic Setup Example

lib/logger.ts
typescript
import { createLogger } from "@notlogs/next";

export const logger = createLogger({
  apikey: process.env.NOTLOGS_API_KEY!,
  appName: "my-production-app",
  enviorment: process.env.NODE_ENV || "production",
});

Automatic Batching & Shutdown

The SDK automatically buffers log events in memory and flushes them in batches every 2 seconds or when the buffer reaches capacity. On process shutdown (SIGTERM / SIGINT), the SDK flushes all remaining events gracefully before exiting.