How to use @cdm-logger/server - 10 common examples

To help you get started, we’ve selected a few @cdm-logger/server examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cdmbase / fullstack-pro / servers / backend-server / src / index.ts View on Github external
module.hot.status(event => {
        if (event === 'abort' || event === 'fail') {
            logger.error('HMR error status: ' + event);
            // Signal webpack.run.js to do full-reload of the back-end
            service.gracefulShutdown(event);
        }
        // adddintionally when event is idle due to external modules
        if (event === 'idle') {
            service.gracefulShutdown(event);
        }
    });
    module.hot.accept();
github cdmbase / fullstack-pro / servers / backend-server / src / server_old.ts View on Github external
module.hot.accept(['./middleware/graphql'], () => {
        logger.debug('loading ./middleware/graphql');
    });
    // module.hot.accept(['./api/subscriptions'], () => {
github cdmbase / fullstack-pro / servers / backend-server / src / graphql-server.ts View on Github external
onConnect: async (connectionParams, webSocket) => {
                logger.debug(`Subscription client connected using built-in SubscriptionServer.`);
                const pureContext = await modules.createContext(connectionParams, webSocket);
                const contextServices = await serviceContext(connectionParams, webSocket);
                return {
                    ...contextServices,
                    ...pureContext,
                    preferences: defaultPreferences,
                    update: updateContainers,
                };
            },
            // onDisconnect: () => {},
github cdmbase / graphql-nats-subscriptions / src / __tests__ / logger.ts View on Github external
import { ConsoleLogger, IConsoleLoggerSettings } from '@cdm-logger/server';
import * as Logger from 'bunyan';

const settings: IConsoleLoggerSettings = {
    level: 'trace',
};

export const logger: Logger = ConsoleLogger.create('nats-subcscription', settings);
github cdmbase / fullstack-pro / servers / frontend-server / src / backend / app.ts View on Github external
process.on('uncaughtException', ex => {
    logger.error(ex);
    process.exit(1);
});
github cdmbase / fullstack-pro / servers / backend-server / src / service.ts View on Github external
public async gracefulShutdown(signal) {
        try {
            logger.info(`${signal} received. Closing connections, stopping server`);
            await this.app.cleanup();
            logger.info('Shutting down');
        } catch (err) {
            logger.error('Error during graceful shutdown');
            logger.error(err);
        } finally {
            process.exit(0);
        }
    }
}
github cdmbase / fullstack-pro / servers / backend-server / src / service.ts View on Github external
public async gracefulShutdown(signal) {
        try {
            logger.info(`${signal} received. Closing connections, stopping server`);
            await this.app.cleanup();
            logger.info('Shutting down');
        } catch (err) {
            logger.error('Error during graceful shutdown');
            logger.error(err);
        } finally {
            process.exit(0);
        }
    }
}
github cdmbase / fullstack-pro / servers / frontend-server / src / backend / server.ts View on Github external
module.hot.dispose(() => {
        try {
            if (server) {
                server.close();
            }
        } catch (error) {
            logger.error(error.stack);
        }
    });
    module.hot.accept(['./website'], () => {
github cdmbase / fullstack-pro / servers / frontend-server / src / backend / app.ts View on Github external
process.on('unhandledRejection', reason => {
    logger.error(reason);
});
github cdmbase / fullstack-pro / servers / backend-server / src / index.ts View on Github external
process.on('unhandledRejection', reason => {
    logger.error(reason);
});
const service = new Service();

@cdm-logger/server

Universal - Logger

MIT
Latest version published 5 months ago

Package Health Score

53 / 100
Full package analysis