class IPLoggerApp(BaseParallelApplication): name = 'iplogger' description = _description config_file_name = Unicode(default_config_file_name) classes = [LogWatcher, ProfileDir] aliases = Dict(aliases) def initialize(self, argv=None): super(IPLoggerApp, self).initialize(argv) self.init_watcher() def init_watcher(self): try: self.watcher = LogWatcher(config=self.config, log=self.log) except: self.log.error("Couldn't start the LogWatcher", exc_info=True) self.exit(1) self.log.info("Listening for log messages on %r"%self.watcher.url) def start(self): self.watcher.start() try: self.watcher.loop.start() except KeyboardInterrupt: self.log.critical("Logging Interrupted, shutting down...\n")
class IPLoggerApp(BaseParallelApplication): name = u'iplogger' description = _description classes = [LogWatcher, ProfileDir] aliases = Dict(aliases) @catch_config_error def initialize(self, argv=None): super(IPLoggerApp, self).initialize(argv) self.init_watcher() def init_watcher(self): try: self.watcher = LogWatcher(parent=self, log=self.log) except: self.log.error("Couldn't start the LogWatcher", exc_info=True) self.exit(1) self.log.info("Listening for log messages on %r" % self.watcher.url) def start(self): self.watcher.start() try: self.watcher.loop.start() except KeyboardInterrupt: self.log.critical("Logging Interrupted, shutting down...\n")
class IPLoggerApp(ApplicationWithClusterDir): name = u'iploggerz' description = _description command_line_loader = IPLoggerAppConfigLoader default_config_file_name = default_config_file_name auto_create_cluster_dir = True def create_default_config(self): super(IPLoggerApp, self).create_default_config() # The engine should not clean logs as we don't want to remove the # active log files of other running engines. self.default_config.Global.clean_logs = False # If given, this is the actual location of the logger's URL file. # If not, this is computed using the profile, app_dir and furl_file_name self.default_config.Global.url_file_name = u'iplogger.url' self.default_config.Global.url_file = u'' def post_load_command_line_config(self): pass def pre_construct(self): super(IPLoggerApp, self).pre_construct() def construct(self): # This is the working dir by now. sys.path.insert(0, '') self.start_logging() try: self.watcher = LogWatcher(config=self.master_config, logname=self.log.name) except: self.log.error("Couldn't start the LogWatcher", exc_info=True) self.exit(1) def start_app(self): try: self.watcher.start() self.watcher.loop.start() except KeyboardInterrupt: self.log.critical("Logging Interrupted, shutting down...\n")