Skip to content

Commit

Permalink
Specify log filename
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewberryman committed Jul 15, 2016
1 parent ed10035 commit 0fd898f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions device/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ config.logger.level = "info"; // What level to log at; info, verbose or debug ar
config.logger.maxFileSize = 1024 * 1024 * 100; // Max file size in bytes of each log file; default 100MB
config.logger.maxFiles = 10; // Max number of log files kept
config.logger.logDirectory = '/home/pi/cognicity-floodsensor/logs'; // Set this to a full path to a directory - if not set logs will be written to the application directory.
config.logger.logFileName = 'cognicity-floodsensor.log'

module.exports = config;
3 changes: 1 addition & 2 deletions device/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ try {
console.log( "Log directory '" + logPath + "' cannot be written to" );
throw e;
}
logPath += path.sep;
logPath += config.instance + ".log";
logPath += path.sep + config.logger.logFileName;

logger
.add(logger.transports.File, {
Expand Down

0 comments on commit 0fd898f

Please sign in to comment.