flogged 1.0.1 flogged: ^1.0.1 copied to clipboard
Log to Logstash from Flutter applications using lumberdash
Flogged #
A logger for Lumberdash which sends logs to a Logstash instance.
Installation and Setup #
- Include the package as a Git dependency:
dependencies:
# ...
lumberdash: ^2.1.1 # Required for Flogged to work
flogged:
git: git@github.com:netsells/flogged
- Set up your
AndroidManifest.xml
file by adding the following to theapplication
tag:
android:usesCleartextTraffic="true"
- 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>
- In
main.dart
, before callingrunApp
, 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.
- Log some stuff!