File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
config/dependency-injection Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,10 @@ services:
77 class : ../../../../Mooc/Courses/application/CreateCourse
88 arguments : ["@Mooc.courses.CourseRepository"]
99
10+ Mooc.shared.WinstonLogger :
11+ class : ../../../../Mooc/Shared/infrastructure/WinstonLogger
12+ arguments : []
13+
1014 Apps.mooc.controllers.CreateCourseController :
1115 class : ../../controllers/CreateCourseController
1216 arguments : ["@Mooc.courses.CreateCourse"]
Original file line number Diff line number Diff line change 11import errorHandler from 'errorhandler' ;
22import app from './app' ;
3+ import container from './config/dependency-injection' ;
34
45/**
56 * Error Handler. Provides full stack - remove for production
@@ -11,7 +12,9 @@ app.use(errorHandler());
1112 */
1213const server = app . listen ( app . get ( 'port' ) , ( ) => {
1314 // tslint:disable: no-console
14- console . log ( ' App is running at http://localhost:%d in %s mode' , app . get ( 'port' ) , app . get ( 'env' ) ) ;
15+ const winstonLogger = container . get ( 'Mooc.shared.WinstonLogger' ) ;
16+
17+ winstonLogger . info ( ` App is running at http://localhost:${ app . get ( 'port' ) } in ${ app . get ( 'env' ) } mode` ) ;
1518 console . log ( ' Press CTRL-C to stop\n' ) ;
1619} ) ;
1720
You can’t perform that action at this time.
0 commit comments