Last updated:
0 purchases
logdna
logdna #
A simple logdna client for Flutter. Logging made easy.
LogDNA is a log management platform that integrates with many platforms. All logs are accessible in a centralized dashboard with features such as analysis, monitoring, filters and alerts.
Getting Started #
To get started, create an account on logdna.com and get your ingestion API key. The set up process is straightforward. Here's a link to the quickstart guide (https://docs.logdna.com/docs/logdna-quick-start-guide).
Installing the package #
Add this to your project's pubspec.yaml file
dependencies:
logdna: ^1.1.2
copied to clipboard
Run flutter pub get
Usage #
Import the package to your Dart code
import 'package:logdna/logdna.dart';
copied to clipboard
Instantiate the LogDna object
logDna = LogDNA(
apiKey: "YOUR_API_KEY",
hostName: "HOSTNAME");
copied to clipboard
Add logs using the logDna object.
logDna.log(DnaLine(
timestamp: DateTime.now().toUtc().millisecondsSinceEpoch.toString(),
line: "event happened",
level: DnaLevel.debug,
app "APP NAME"
env: DnaEnv.production,
meta: {
"custom field":"custom value",
"custom field 2": "custom value 2"
}
));
copied to clipboard
Alternatively, you can create the log line separately and pass it into the log method.
line = DnaLine(
timestamp: DateTime.now().toUtc().millisecondsSinceEpoch.toString(),
line: "event happened",
level: DnaLevel.debug,
app: "APP NAME"
env: DnaEnv.production,
meta: {
"custom field":"custom value",
"custom field 2": "custom value 2"
}
);
copied to clipboard
You can add custom values after creating the 'DnaLine' instance.
line.addCustomField(CustomField(name:"custom name", value: "Custom value"));
copied to clipboard
You've pushed your log to LogDNA! Check your LogDNA dashboard. Your new log line should appear.
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.