From 0bd14bfcbe4ce565f14d8eb8622ac073fe467038 Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 9 Apr 2019 14:29:02 +0200 Subject: [PATCH] fix logging to stdout and document logging configuration --- config/config.example.js | 26 +++++++++++++++++++++++--- lib/log.js | 1 + 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/config/config.example.js b/config/config.example.js index 1fae5ae9c..6aaec1426 100644 --- a/config/config.example.js +++ b/config/config.example.js @@ -277,6 +277,11 @@ module.exports = { */ blobStagingPath: './blobstage', + /* CryptPad supports logging events directly to the disk in a 'logs' directory + * Set its location here, or set it to false if you'd rather not log + */ + logPath: './data/logs', + /* ===================== * Debugging * ===================== */ @@ -286,10 +291,18 @@ module.exports = { */ logToStdout: false, - /* CryptPad supports verbose logging - * (false by default) + /* CryptPad can be configured to log more or less + * the various settings are listed below by order of importance + * + * silly, debug, verbose, feedback, info, warn, error + * + * Choose the least important level of logging you wish to see. + * For example, a 'silly' logLevel will display everything, + * while 'info' will display 'info', 'warn', and 'error' logs + * + * This will affect both logging to the console and the disk. */ - verbose: false, + logLevel: 'info', /* clients can use the /settings/ app to opt out of usage feedback * which informs the server of things like how much each app is being @@ -297,6 +310,9 @@ module.exports = { * the client's browser. The intent is to provide feedback to the admin * such that the service can be improved. Enable this with `true` * and ignore feedback with `false` or by commenting the attribute + * + * You will need to set your logLevel to include 'feedback'. Set this + * to false if you'd like to exclude feedback from your logs. */ logFeedback: false, @@ -336,4 +352,8 @@ module.exports = { */ rpc: './rpc.js', + /* CryptPad supports verbose logging + * (false by default) + */ + verbose: false, }; diff --git a/lib/log.js b/lib/log.js index 31e324075..f8aad4978 100644 --- a/lib/log.js +++ b/lib/log.js @@ -86,6 +86,7 @@ Logger.create = function (config, cb) { channelName: launchTime, logFeedback: Boolean(config.logFeedback), logLevel: config.logLevel, + logToStdout: config.logToStdout, }; if (!config.logPath) {