remote_logger

Last updated:

0 purchases

remote_logger Image
remote_logger Images
Add to Cart

Description:

remote logger

Dart library for posting logs to a remote storage. Use together with logging
library.
Features #

✅ Post log message to remote server
✅ Provide custom headers
✅ Override request body
✅ Retry on errors with exponential timeout
❌ TODO: cache/store information locally

Usage #
void main() {
Logger.root.level = Level.ALL;

final logger = Logger('TestLogger');

// Create remote logger.
final remoteLogger = RemoteLogger(
url: Uri.parse('http://example.com'),
// Optionally, override the body of the request.
getBody: (record, body) => <String, dynamic>{
...body,
'level': record.level.toString(),
},
// Optionally, provide additional headers.
getHeaders: (headers) => <String, String>{
...headers,
'X-License-Key': 'TEST_KEY',
},
);

// Set remoteLogger as a listener.
Logger.root.onRecord.listen(remoteLogger);

// Log a message.
logger.info('Test message');
}
copied to clipboard
Additional information #
Please file feature requests and bugs at the issue tracker.

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.