예제 #1
0
    async def _prepare(self):
        log.debug(f'Router <{self.router_cls.__name__}> initialize')
        self._router = self.router_cls(self._methods)

        self._logging_config = get_logging_config(self.config.app)
        logging.config.dictConfig(self._logging_config)

        await self._add_health_if_needed()
예제 #2
0
    def _preload_server(self):
        if self.config.driver.sentry_dsn:
            sentry_sdk.init(
                dsn=self.config.driver.sentry_dsn,
                integrations=[SanicIntegration()],
                environment=self.config.driver.sentry_env
            )

        self._sanic = Sanic(name=self.name, log_config=get_logging_config(self.config.app))
        self._sanic.config = self.config.driver.get_sanic_config()
예제 #3
0
    def _preload_server(self):
        if self.config.driver.sentry_dsn:
            sentry_kwargs = dict(
                dsn=self.config.driver.sentry_dsn,
                integrations=[SanicIntegration()],
                environment=self.config.driver.sentry_env,
                release=self.config.driver.version,
                ignore_errors=self.config.driver.sentry_ignore_errors,
                **self.config.driver.sentry_kwargs,
            )
            sentry_kwargs.update(self.config.driver.sentry_kwargs)
            sentry_sdk.init(**sentry_kwargs)

        self._sanic = Sanic(name=self.name,
                            log_config=get_logging_config(self.config.app))
        self._sanic.config = self.config.driver.get_sanic_config()
예제 #4
0
 def _apply_logging(self):
     self._logging_config = get_logging_config(self.config.app)
     logging.config.dictConfig(self._logging_config)
예제 #5
0
 def _setup_logging(self, *args, **kwargs):
     from logging.config import dictConfig
     dictConfig(get_logging_config(self.config))