Skip to content
Snippets Groups Projects
Commit f96ec715 authored by Andrew Newdigate's avatar Andrew Newdigate
Browse files

Feature: use different interpolation values for different logging events

parent 7c5a9190
No related branches found
No related tags found
1 merge request!6✨ Feature: write stats to Kibana
Loading
Loading
@@ -91,13 +91,16 @@ exports.create = function(options) {
logger.on('logging', function (transport, level) {
switch(level) {
case 'warn':
statsdClient.increment('logged.warn', 1, 0.1, logTags);
// Record 20% of warnings
statsdClient.increment('logged.warn', 1, 0.2, logTags);
break;
case 'error':
statsdClient.increment('logged.error', 1, 0.1, logTags);
// Record 50% of errors
statsdClient.increment('logged.error', 1, 0.5, logTags);
break;
case 'fatal':
statsdClient.increment('logged.fatal', 1, 0.1, logTags);
// Record 100% of fatal
statsdClient.increment('logged.fatal', 1, 1, logTags);
break;
}
});
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment