How to Set Up Log Monitoring in 10 Minutes
Published 2026-01-20 · Updated 2026-03-01
>_ why most developers skip log monitoring (and regret it)
>_ step 1: create your logmonitor account
>_ step 2: install the sdk (javascript)
npm install logmonitor-js>_ step 3: initialize logmonitor (javascript)
import { logmonitor } from 'logmonitor-js';// Initialize LogMonitor with your API keylogmonitor.init({ apiKey: 'your-api-key' });// The SDK auto-patches console.log, console.info, console.warn, console.error, and console.debug.// Logs are only sent in production.console.log('App started successfully');console.warn('Cache miss for user preferences');console.error('Failed to load user profile', { userId: '12345' });>_ step 4: install and initialize (flutter)
dependencies: logmonitor_flutter: ^1.0.0 logging: ^1.2.0>_ step 5: initialize and use logmonitor in flutter
import 'package:logmonitor_flutter/logmonitor_flutter.dart';import 'package:logging/logging.dart';final _log = Logger('MyApp');void main() async { WidgetsFlutterBinding.ensureInitialized(); // Initialize LogMonitor await Logmonitor.init(apiKey: 'your-api-key'); // Uses package:logging for log calls. Logs are only sent in release mode. _log.info('App initialized successfully'); _log.warning('Slow network detected'); _log.severe('Payment processing failed'); runApp(const MyApp());}>_ step 6: using the http api (any platform)
curl -X POST https://api.logmonitor.io/v1/logs \ -H "X-Logmonitor-Api-Key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '[{ "level": "error", "message": "Database connection timeout", "app": "my-backend-api", "environment": "production", "data": { "host": "db-primary.internal", "timeout_ms": 5000 } }]'# Response: 202 Accepted>_ step 7: verify your setup and use log switch
- $Check the live console at app.logmonitor.io
- $Verify logs from different levels appear (log, warn, error)
- $Try searching and filtering logs
- $Enable Log Switch for a test user
- $Alerting is on the roadmap but not yet available
>_ frequently asked questions
No. The SDK is lightweight, asynchronous, and batches logs before sending. Log transmission happens in the background and does not block your application's main thread. The SDK has been tested under high load with zero measurable performance impact.
The SDK buffers logs locally when the network is unavailable and sends them when connectivity is restored. No logs are lost during brief network interruptions.
Yes. Use the environment parameter to separate development and production logs. You can filter by environment in the LogMonitor console. Many teams use LogMonitor in development for debugging and in production for monitoring.
Be intentional about what you log. Avoid logging passwords, tokens, credit card numbers, or personal identifiable information. LogMonitor does not automatically capture any data — it only sends what you explicitly log via the SDK or API.