Skip to content
Snippets Groups Projects
Commit f7fe0b0d authored by Lloyd Hilaiel's avatar Lloyd Hilaiel
Browse files

determine 'process type' and prepend it to metrics log - issue #169

parent 8bfe3a5a
No related branches found
No related tags found
No related merge requests found
...@@ -130,3 +130,14 @@ exports.performSubstitution = function(app) { ...@@ -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';
}
...@@ -80,7 +80,7 @@ function setupLogger() { ...@@ -80,7 +80,7 @@ function setupLogger() {
else else
mkdir_p(log_path); 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)({ LOGGER = new (winston.Logger)({
transports: [new (winston.transports.File)({filename: filename})] transports: [new (winston.transports.File)({filename: filename})]
......
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