Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ookami-kb/insightops_dart
Unofficial wrapper for using Rapid7 insightOps logs (former LogEntries) with Dart.
https://github.com/ookami-kb/insightops_dart
dart dart-library dart2 dartlang insightops logentries logging logging-library rapid7
Last synced: 20 days ago
JSON representation
Unofficial wrapper for using Rapid7 insightOps logs (former LogEntries) with Dart.
- Host: GitHub
- URL: https://github.com/ookami-kb/insightops_dart
- Owner: ookami-kb
- License: bsd-2-clause
- Created: 2019-09-16T16:20:07.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-04-17T11:22:08.000Z (9 months ago)
- Last Synced: 2024-10-06T03:08:00.946Z (3 months ago)
- Topics: dart, dart-library, dart2, dartlang, insightops, logentries, logging, logging-library, rapid7
- Language: Dart
- Homepage: https://pub.dev/packages/insightops_dart
- Size: 22.5 KB
- Stars: 2
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
![](https://github.com/ookami-kb/insightops_dart/workflows/Dart%20CI/badge.svg)
An unofficial wrapper for using Rapid7 insightOps logs (former LogEntries) with Dart.
This package is using [logging] package to do the actual logging, and implements a handler to post the message to
insightOps.## Setting up
Set up a new log by following the [instructions], copy a URL that you will use to send your log data to.
## Usage
A simple usage example:
```dart
import 'package:insightops_dart/insightops_dart.dart';
import 'package:logging/logging.dart';main() {
// Create handler and pass the URL from log settings.
final handler = InsightOpsLogger('__LOG_URL__');// Define settings for the logger.
Logger.root.level = Level.ALL;
Logger.root.onRecord.listen(handler);// Create logger.
final logger = Logger('Test logger');// Log info message.
logger.info('test message');// Log errors with stacktrace.
try {
throw Error();
} catch (e, stackTrace) {
logger.severe('Test failure', e, stackTrace);
}
}
```### Update body of the message
You can optionally pass `transformBody` parameter to the constructor. This method will be called with each request with
the body of the message. You can use it to update the body:```dart
final handler = InsightOpsLogger(
'__LOG_URL__',
transformBody: (body) async =>
{
'meta': {'deviceId': 'ID'},
...body,
},
);
```## Features and bugs
Please file feature requests and bugs at the [issue tracker][tracker].
[tracker]: https://github.com/ookami-kb/insightops_dart/issues
[instructions]: https://insightops.help.rapid7.com/docs/insightops-webhook#section-create-a-log-to-send-your-data-to
[logging]: https://pub.dev/packages/logging