diff --git a/libs/configuration.js b/libs/configuration.js index 333d9598b77b72f4b70fc00edba696fe029ab023..84c179bb576e54c249c39986e2094b456db9cbef 100644 --- a/libs/configuration.js +++ b/libs/configuration.js @@ -130,3 +130,14 @@ exports.performSubstitution = function(app) { } }; +// At the time this file is required, we'll determine the "process name" for this proc +// if we can determine what type of process it is (browserid or verifier) based +// on the path, we'll use that, otherwise we'll name it 'ephemeral'. +if (process.argv[1] == path.join(__dirname, "..", "browserid", "run.js")) { + g_config['process_type'] = 'browserid'; +} else if (process.argv[1] == path.join(__dirname, "..", "verifier", "run.js")) { + g_config['process_type'] = 'verifier'; +} else { + g_config['process_type'] = 'ephemeral'; +} + diff --git a/libs/metrics.js b/libs/metrics.js index ae0aaf35434519bc129282a088ab0263038e5a9e..8b23a3e0a8715e604c6640ce296f5938b87772f1 100644 --- a/libs/metrics.js +++ b/libs/metrics.js @@ -80,7 +80,7 @@ function setupLogger() { else mkdir_p(log_path); - var filename = path.join(log_path, "metrics.json"); + var filename = path.join(log_path, configuration.get('process_type') + "-metrics.json"); LOGGER = new (winston.Logger)({ transports: [new (winston.transports.File)({filename: filename})]