File tree Expand file tree Collapse file tree 5 files changed +18
-19
lines changed Expand file tree Collapse file tree 5 files changed +18
-19
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ $ ./example.js run
24
24
```
25
25
26
26
## 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.
27
28
* 0.13.1 - Made session resave, saveUninitialized, and rolling configurable. Fixed view cache typo
28
29
* 0.13.0 - Added human readable log option. Fixed issue where pid wasn't created for single instance of cluster, updated dependency versions.
29
30
* 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
Original file line number Diff line number Diff line change @@ -80,6 +80,13 @@ var config = {
80
80
* @type {Object }
81
81
*/
82
82
logging : {
83
+
84
+ /**
85
+ * What log format to use for access logs. Typically dev or combined
86
+ * @type {String }
87
+ */
88
+ accessLogFormat : 'combined' ,
89
+
83
90
/**
84
91
* Include json logs
85
92
* @type {Boolean }
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " ceres-framework" ,
3
- "version" : " 0.13.1 " ,
3
+ "version" : " 0.13.2 " ,
4
4
"description" : " Node.js Framework for React Applications" ,
5
5
"main" : " src/index.js" ,
6
6
"bin" : {
Original file line number Diff line number Diff line change @@ -129,23 +129,14 @@ module.exports = function Server(ceres) {
129
129
/*****************************************************************************
130
130
* Logging
131
131
*/
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 ) ;
149
140
150
141
/*****************************************************************************
151
142
* Throttle all requests
Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ module.exports.init = function(ceres) {
140
140
transports : setupTransports ( ceres . config , 'ceres' )
141
141
} ) ;
142
142
143
- winston . info ( 'Writing logs to %s' , ceres . config . folders . logs ) ;
143
+ winston . silly ( 'Writing logs to %s' , ceres . config . folders . logs ) ;
144
144
145
145
return winston ;
146
146
} ;
You can’t perform that action at this time.
0 commit comments