logdna 0.0.2 copy "logdna: ^0.0.2" to clipboard
logdna: ^0.0.2 copied to clipboard

outdated

A simple logdna client for Flutter. Push logs directly to your LogDNA dashboard in a few lines of code.

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: ^0.0.2

Run flutter pub get

Usage #

Import the package to your Dart code

import 'package:logdna/logdna.dart';

Instantiate the LogDna object

logDna = LogDNA(
        apiKey: "YOUR_API_KEY",
        appName: "APP_NAME",
        hostName: "HOSTNAME");

Add logs using the logDna object.

logDna.log(DnaLine(
      timestamp: DateTime.now().toUtc().millisecondsSinceEpoch.toString(),
      line: "event happened",
      level: DnaLevel.debug,
      env: DnaEnv.production,
      meta: {
        "custom field":"custom value",
        "custom field 2": "custom value 2"
      }
    ));

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,
      env: DnaEnv.production,
      meta: {
        "custom field":"custom value",
        "custom field 2": "custom value 2"
      }
    );

You can add custom values after creating the 'DnaLine' instance.

line.addCustomField(CustomField(name:"custom name", value: "Custom value"));

You've pushed your log to LogDNA! Check your LogDNA dashboard. Your new log line should appear.

8
likes
0
pub points
61%
popularity

Publisher

verified publisheraligorithm.i.ng

A simple logdna client for Flutter. Push logs directly to your LogDNA dashboard in a few lines of code.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, http

More

Packages that depend on logdna