Flogged

A logger for Lumberdash which sends logs to a Logstash instance.

Installation and Setup

  1. Include the package as a Git dependency:
dependencies:
  # ...
  lumberdash: ^2.1.1 # Required for Flogged to work
  flogged:
    git: git@github.com:netsells/flogged
  1. Set up your AndroidManifest.xml file by adding the following to the application tag:
android:usesCleartextTraffic="true"
  1. Add the following to your Info.plist file, being sure to replace example entries:
<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
    <key>NSExceptionDomains</key>
    <dict>
        <key>my.logstash.instance</key>
        <dict>
            <key>NSExceptionAllowsInsecureHTTPLoads</key>
            <true/>
            <key>NSIncludesSubdomains</key>
            <true/>
        </dict>
    </dict>
</dict>
  1. In main.dart, before calling runApp, add these lines, replacing example content:
WidgetsFlutterBinding.ensureInitialized();
putLumberdashToWork(withClients: [
    FloggedLumberdash(
        appName: 'Flogged Test',
        appVersionName: '2.0.0',
        appVersionCode: 234,
        environment: kReleaseMode ? 'production' : 'debug',
        logstashUrl: 'http://my.logstash.instance',
        logstashPort: 5001,
    ),
]);

Use the package_info package to dynamically retrieve app version information.

  1. Log some stuff!

Libraries

flogged
Log to Logstash from Dart applications, using Lumberdash.