HTTP request logging middleware for the Dart server ecosystem.
Inspired by Morgan and built for Dart 3.
| Package | Description | Version |
|---|---|---|
axon_core |
Zero-dependency token engine, format compiler, serializers | |
axon_shelf |
Shelf middleware adapter | |
axon_dart_frog |
Dart Frog middleware adapter |
Planned:
axon_dio
dart pub add axon_shelfimport 'package:axon_shelf/axon_shelf.dart';
import 'package:shelf/shelf.dart';
import 'package:shelf/shelf_io.dart' as io;
void main() async {
final handler = Pipeline()
.addMiddleware(axonShelf())
.addHandler((req) => Response.ok('hello'));
await io.serve(handler, 'localhost', 8080);
}Output:
GET / 200 3 ms
POST /api/users 201 12 ms
GET /api/users/42 404 1 ms| Feature | Morgan (Node.js) | Axon (Dart) |
|---|---|---|
| Format strings | ✅ | ✅ |
| Predefined formats | ✅ | ✅ |
| Custom tokens | ✅ | ✅ |
| JSON output | ❌ (manual workaround) | ✅ Native |
| Numeric types in JSON | ❌ | ✅ int/double preserved |
| Header masking | ❌ | ✅ MaskingRules |
| Type safety | ❌ (JavaScript) | ✅ Dart 3 sealed classes |
| Fail-fast on bad format | ❌ | ✅ FormatCompilationError |
Auth-agnostic :remote-user |
❌ | ✅ UserExtractor |
| TTY color auto-detect | ❌ | ✅ dart:io detection |
This repository is managed with Melos.
dart pub global activate melos
melos bootstrap # install all dependencies
melos test # run all tests
melos analyze # dart analyze across packages
melos format # dart format across packages
melos publish:dry # dry-run publish checkContributions are welcome. Please open an issue before submitting a PR for non-trivial changes.
- Follow Conventional Commits: Melos uses them for versioning.
- Run
melos analyzeandmelos format:checkbefore pushing. - Add tests for any new token or serializer.
- Open an issue before submitting a PR for non-trivial changes
MIT — see LICENSE.