11const cp = require ( './service/individualServices/CyclicProcessService/cyclicProcess' ) ;
2+ const logger = require ( './service/LoggingService.js' ) . getLogger ( ) ;
23
34'use strict' ;
45
@@ -15,14 +16,14 @@ const { env } = require('process');
1516// uncomment if you do not want to validate security e.g. operation-key, basic auth, etc
1617//appCommons.openApiValidatorOptions.validateSecurity = false;
1718if ( process . env . DEBUG && process . env . DEBUG . toLowerCase ( ) === "true" ) {
18- console . warn ( "Working in debug mode" ) ;
19- console . warn ( "Checking validation" )
19+ logger . warn ( "Working in debug mode" ) ;
20+ logger . warn ( "Checking validation" )
2021 appCommons . openApiValidatorOptions . validateSecurity = false ;
2122 // appCommons.openApiValidatorOptions.validateResponses = false;
2223 // appCommons.openApiValidatorOptions.validateRequests = false;
23- console . warn ( "Validate Security: " + appCommons . openApiValidatorOptions . validateSecurity ) ;
24- console . warn ( "Validate Responses: " + appCommons . openApiValidatorOptions . validateResponses ) ;
25- console . warn ( "Validate Requests: " + appCommons . openApiValidatorOptions . validateRequests ) ;
24+ logger . warn ( "Validate Security: " + appCommons . openApiValidatorOptions . validateSecurity ) ;
25+ logger . warn ( "Validate Responses: " + appCommons . openApiValidatorOptions . validateResponses ) ;
26+ logger . warn ( "Validate Requests: " + appCommons . openApiValidatorOptions . validateRequests ) ;
2627}
2728
2829// swaggerRouter configuration
@@ -39,19 +40,19 @@ appCommons.setupExpressApp(app);
3940
4041global . databasePath = './database/load.json'
4142if ( process . env . DEBUG && process . env . DEBUG . toLowerCase ( ) === "true" ) {
42- console . warn ( "Working in debug mode" ) ;
43+ logger . warn ( "Working in debug mode" ) ;
4344 global . databasePath = './server/database/load.json'
44- console . warn ( "Load data from: " + global . databasePath )
45+ logger . warn ( "Load data from: " + global . databasePath )
4546}
4647
4748prepareElasticsearch ( ) . catch ( err => {
48- console . error ( `Error preparing Elasticsearch : ${ err } ` ) ;
49+ logger . error ( `Error preparing Elasticsearch : ${ err } ` ) ;
4950} ) . finally (
5051 ( ) => {
5152 // Initialize the Swagger middleware
5253 http . createServer ( app ) . listen ( serverPort , function ( ) {
53- console . log ( 'Your server is listening on port %d (http://localhost:%d)' , serverPort , serverPort ) ;
54- console . log ( 'Swagger-ui is available on http://localhost:%d/docs' , serverPort ) ;
54+ logger . info ( 'Your server is listening on port %d (http://localhost:%d)' , serverPort , serverPort ) ;
55+ logger . info ( 'Swagger-ui is available on http://localhost:%d/docs' , serverPort ) ;
5556 } ) ;
5657 appCommons . performApplicationRegistration ( ) ;
5758
0 commit comments