From 320998ef786f866f69d2a8cc2939ad12ef4fa428 Mon Sep 17 00:00:00 2001 From: Clement Michaud Date: Sun, 22 Jan 2017 18:18:19 +0100 Subject: [PATCH] Set the level of logs in the config file --- config.template.yml | 2 ++ src/index.js | 1 + src/lib/server.js | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/config.template.yml b/config.template.yml index bef6d1089..5b2097584 100644 --- a/config.template.yml +++ b/config.template.yml @@ -1,4 +1,6 @@ +debug_level: info + ldap: url: ldap://ldap base_dn: ou=users,dc=example,dc=com diff --git a/src/index.js b/src/index.js index 4e9a10385..ddc2d9a75 100644 --- a/src/index.js +++ b/src/index.js @@ -18,6 +18,7 @@ var config = { session_secret: yaml_config.session.secret, session_max_age: yaml_config.session.expiration || 3600000, // in ms store_directory: yaml_config.store_directory, + debug_level: yaml_config.debug_level, gmail: { user: yaml_config.notifier.gmail.username, pass: yaml_config.notifier.gmail.password diff --git a/src/lib/server.js b/src/lib/server.js index fe2394fc6..e3d9f40ca 100644 --- a/src/lib/server.js +++ b/src/lib/server.js @@ -44,7 +44,7 @@ function run(config, ldap_client, u2f, fn) { app.set('views', view_directory); app.set('view engine', 'ejs'); - winston.level = 'debug'; + winston.level = config.debug_level || 'info'; app.set('logger', winston); app.set('ldap client', ldap_client);