Send logs from Flutter and Dart apps to BunnyLogs in real time using the bunnylogs_flutter package — fire-and-forget HTTP POSTs, no platform-specific code required.
flutter pub add bunnylogs_flutter
Or add it manually to pubspec.yaml:
dependencies:
bunnylogs_flutter: ^0.1.0
Then run:
flutter pub get
The simplest approach — no extra dependencies needed:
import 'package:bunnylogs_flutter/bunnylogs_flutter.dart';
final logger = BunnyLogger(uuid: '<your-uuid>');
logger.info('User signed in: $userId');
logger.warning('Cache miss — fetching from network');
logger.error('Payment failed: $error');
Replace <your-uuid> with the UUID from your stream URL (https://bunnylogs.com/live/<uuid>).
logger packageUse BunnyLogsOutput as a LogOutput alongside ConsoleOutput to keep terminal output while also shipping to BunnyLogs:
import 'package:logger/logger.dart';
import 'package:bunnylogs_flutter/bunnylogs_flutter.dart';
final log = Logger(
filter: kDebugMode ? DevelopmentFilter() : ProductionFilter(),
output: MultiOutput([
ConsoleOutput(),
BunnyLogsOutput(uuid: '<your-uuid>'),
]),
printer: SimplePrinter(printTime: false),
);
log.i('Server started');
log.w('Cache miss — fetching from network');
log.e('Payment failed', error: e, stackTrace: s);
ProductionFilter suppresses trace and debug messages in release builds automatically.
Both BunnyLogger and BunnyLogsOutput accept the same options:
| Parameter | Default | Description |
|---|---|---|
uuid | required | Logspace UUID from your stream URL |
program | 'flutter' | Identifies the source in the log stream |
minLevel | BunnyLevel.verbose | Drops records below this level |
enabled | true | Set to false to disable all shipping |
endpoint | 'https://bunnylogs.com' | Override for self-hosted instances |
Example — only ship warnings and above in production:
final logger = BunnyLogger(
uuid: '<your-uuid>',
minLevel: BunnyLevel.warning,
enabled: !kDebugMode,
);
Create separate logger instances per feature to distinguish sources in the program field:
final networkLog = BunnyLogger(uuid: '<your-uuid>', program: 'flutter/network');
final authLog = BunnyLogger(uuid: '<your-uuid>', program: 'flutter/auth');
final uiLog = BunnyLogger(uuid: '<your-uuid>', program: 'flutter/ui');
| BunnyLevel / logger Level | BunnyLogs level |
|---|---|
verbose / trace | VERBOSE |
debug | DEBUG |
info | INFO |
warning | WARN |
error / fatal | ERROR |
output() and the BunnyLogger methods never block the UI thread.http package works on Android, iOS, macOS, Linux, Windows, and web with no additional configuration.--dart-define build variable or a secrets file rather than hardcoding it in source.XMLHttpRequest under the hood — BunnyLogs serves a permissive CORS policy on /live/<uuid> so browser POSTs work out of the box.level=ERROR and program starts with flutter to get notified on errors via Slack, Telegram, or Discord.