Skip to content

Commit 4804501

Browse files
Merge pull request #13 from isuttell/release/0.13.2
Release/0.13.2
2 parents 6b6689a + a535203 commit 4804501

File tree

5 files changed

+18
-19
lines changed

5 files changed

+18
-19
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ $ ./example.js run
2424
```
2525

2626
## History
27+
* 0.13.2 - Reduce log spam related to cron scripts. Fixed issue with access log not always saving and made its format configurable.
2728
* 0.13.1 - Made session resave, saveUninitialized, and rolling configurable. Fixed view cache typo
2829
* 0.13.0 - Added human readable log option. Fixed issue where pid wasn't created for single instance of cluster, updated dependency versions.
2930
* 0.12.0 - Removed rotating access logs. Added option to enable access log skipping. Added trustProxy options. Made compression configurable. Added options to make cookies configurable

config/default.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,13 @@ var config = {
8080
* @type {Object}
8181
*/
8282
logging: {
83+
84+
/**
85+
* What log format to use for access logs. Typically dev or combined
86+
* @type {String}
87+
*/
88+
accessLogFormat: 'combined',
89+
8390
/**
8491
* Include json logs
8592
* @type {Boolean}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ceres-framework",
3-
"version": "0.13.1",
3+
"version": "0.13.2",
44
"description": "Node.js Framework for React Applications",
55
"main": "src/index.js",
66
"bin": {

src/setup/express.js

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -129,23 +129,14 @@ module.exports = function Server(ceres) {
129129
/*****************************************************************************
130130
* Logging
131131
*/
132-
if (ceres.config.env === 'production') {
133-
// Setup logs
134-
var accessLogStream = fs.createWriteStream(ceres.config.folders.logs + '/access.log', {flags: 'a'});
135-
136-
app.use(morgan('combined', {
137-
stream: accessLogStream,
138-
skip: ceres.config.logging && ceres.config.logging.skip
139-
}));
140-
141-
ceres.log._ceres.silly('Access logs configured');
142-
} else {
143-
// Log to console
144-
app.use(morgan('dev',{
145-
skip: ceres.config.logging && ceres.config.logging.skip
146-
}));
147-
ceres.log._ceres.silly('Access logs (dev) configured');
148-
}
132+
var logFilename = ceres.config.folders.logs + '/access.log';
133+
var accessLogStream = fs.createWriteStream(logFilename, {flags: 'a'});
134+
// Log to console
135+
app.use(morgan(ceres.config.logging.accessLogFormat, {
136+
stream: accessLogStream,
137+
skip: ceres.config.logging && ceres.config.logging.skip
138+
}));
139+
ceres.log._ceres.silly('%s sccess log saving to %s', ceres.config.logging.accessLogFormat, logFilename);
149140

150141
/*****************************************************************************
151142
* Throttle all requests

src/setup/logs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ module.exports.init = function(ceres) {
140140
transports: setupTransports(ceres.config, 'ceres')
141141
});
142142

143-
winston.info('Writing logs to %s', ceres.config.folders.logs);
143+
winston.silly('Writing logs to %s', ceres.config.folders.logs);
144144

145145
return winston;
146146
};

0 commit comments

Comments
 (0)