SinkSeq — Flutter logs straight to Seq
· One min read
Version 0.1.0 introduced SinkSeq, allowing Flutter apps to send structured events in CLEF format to Seq servers — the same ecosystem many .NET teams already use.
Why Seq?
Seq offers powerful search over structured properties, dashboards, and alerts. With CLEF, each log is a JSON document with @t, @mt, @l, and arbitrary properties — exactly what LogModel already produces.
Basic usage
final seqSink = SinkSeq(
'https://seq.example.com',
apiKey: 'your-api-key',
deviceIdentifier: 'checkout-app',
);
logger.addSink(seqSink);
await logger.log(
'Order {orderId} placed',
level: LogLevel.info,
data: {'orderId': 'ORD-991'},
);
Improvements in 0.1.1 and 0.1.2
Later releases fixed important production details:
Content-Type: application/vnd.serilog.clefheader on POST- CLEF reserved fields (
@t,@mt,@l,DeviceIdentifier) protected fromdataoverwrites SinkSeq.close()to release the internal HTTP pool- URL validation in release builds
- Trailing slash URL normalization
Testability
The constructor accepts an injected http.Client — essential for unit tests without network:
SinkSeq(
'https://seq.test',
client: mockClient,
);
Learn more
See the full Seq integration guide in the documentation.
