Open jnnwnk opened 4 years ago
We'd like to send the log messages to a CouchDB. Bulk insert is supported by CouchDB. But the payload requires a property named docs (instead of logs).
docs
logs
What about a config value for property name (see https://github.com/kutuluk/loglevel-plugin-remote/blob/master/src/remote.js#L272)
Something like (not tested, might be buggy and is more like pseudo code)
if (isJSON) { let logsPropertyName = config.logPropertyName || "logs" queue.content = {} queue.content[logsPropertyName] = [${logs.join(',')}] } else { queue.content = logs.join('\n') }
We'd like to send the log messages to a CouchDB. Bulk insert is supported by CouchDB. But the payload requires a property named
docs
(instead oflogs
).What about a config value for property name (see https://github.com/kutuluk/loglevel-plugin-remote/blob/master/src/remote.js#L272)
Something like (not tested, might be buggy and is more like pseudo code)