Add the specified log handler to the message ID's routing list.
344433
protected void addMsgToLogHandler(String msgId, String handlerId) {
        Set<String> logHandlerIdSet = getOrCreateLogHandlerIdSet(msgId);
        logHandlerIdSet.add(handlerId);
    }
912003
def addLocalHandlers (logger):
    
    termlog = logging.StreamHandler()
    termlog.setFormatter( LogFormatter() )

    logger.addHandler( termlog )
    logger.addHandler( SysLogHandler() )
    logger.addHandler( SysLogHandler(('localhost', 2514)) )
528043
def add_line(self, logevent):
        """"""
        key = None
        self.empty = False
        self.groups.setdefault(key, list()).append(logevent)
167362
def add(self, handler):
        ''' 

        '''
        self._handlers.append(handler)

        # make sure there is at most one static path
        static_paths = set(h.static_path() for h in self.handlers)
        static_paths.discard(None)
        if len(static_paths) > 1:
            raise RuntimeError("More than one static path requested for app: %r" % list(static_paths))
        elif len(static_paths) == 1:
            self._static_path = static_paths.pop()
        else:
            self._static_path = None
454606
def add_handler(self, handler):
        """"""
        if not callable(handler):
            raise TypeError("'%s' is not callable." % handler)

        self.append(handler)
810358
private void addHandler(Object handler)
    {
        // Would be nice to have a better way to do this,
        // but the type information isn't preserved in the XML format anymore -
        // and the number of types of handler is pretty unlikely to change, so this list
        // won't have to be added to often, if at all.
        if (handler == null)
            return;

        if (handler instanceof IVideoProducer)
            addVideoProducer((IVideoProducer)handler);
        else if (handler instanceof IAudioProducer)
            addAudioProducer((IAudioProducer)handler);
        else if (handler instanceof ICommandHandler)
            addCommandHandler((ICommandHandler)handler);
        else if (handler instanceof IObservationProducer)
            addObservationProducer((IObservationProducer)handler);
        else if (handler instanceof IRewardProducer)
            addRewardProducer((IRewardProducer)handler);
        else if (handler instanceof IWorldGenerator)
            addWorldGenerator((IWorldGenerator)handler);
        else if (handler instanceof IWorldDecorator)
            addWorldDecorator((IWorldDecorator)handler);
        else if (handler instanceof IWantToQuit)
            addQuitProducer((IWantToQuit)handler);
        else
            this.failedHandlers += handler.getClass().getSimpleName() + " isn't of a recognised handler type.\n";
    }
482872
def logger_add (self, loggerclass):
        """"""
        self.loggers[loggerclass.LoggerName] = loggerclass
        self[loggerclass.LoggerName] = {}
164564
protected void routeTo(RoutedMessage routedMessage, String logHandlerId) {
        WsLogHandler wsLogHandler = wsLogHandlerServices.get(logHandlerId);
        if (wsLogHandler != null) {
            wsLogHandler.publish(routedMessage);
        }
    }
917525
def set_handler(self, log, handler):
        
        if self.debug_logging is True:
            log.setLevel(logging.DEBUG)
            handler.setLevel(logging.DEBUG)
        else:
            log.setLevel(logging.INFO)
            handler.setLevel(logging.INFO)

        handler.name = self.name
        handler.setFormatter(self.format)
        log.addHandler(handler)
731535
protected void addRequestHandler(I_CmsRequestHandler handler) {

        if (handler == null) {
            return;
        }
        String[] names = handler.getHandlerNames();
        for (int i = 0; i < names.length; i++) {
            String name = names[i];
            if (m_requestHandlers.get(name) != null) {
                CmsLog.INIT.error(Messages.get().getBundle().key(Messages.LOG_DUPLICATE_REQUEST_HANDLER_1, name));
                continue;
            }
            m_requestHandlers.put(name, handler);
            if (CmsLog.INIT.isInfoEnabled()) {
                CmsLog.INIT.info(
                    Messages.get().getBundle().key(
                        Messages.INIT_ADDED_REQUEST_HANDLER_2,
                        name,
                        handler.getClass().getName()));
            }
        }
    }
144662
def log_request(self, handler):
        
        packet = {'method': handler.request.method,
                  'uri': handler.request.uri,
                  'remote_ip': handler.request.remote_ip,
                  'status': handler.get_status(),
                  'request_time_ms': handler.request.request_time() * 1000.0,
                  'service_id': self.service_id,
                  'request_id': handler.request.headers.get(REQUEST_ID_HEADER,
                                                            'undefined')
                  }

        # handler can optionally define additional data to log
        if hasattr(handler, 'logvalues'):
            for key, value in handler.logvalues.iteritems():
                packet[key] = value

        servicelog.log(packet)

        metric = "requests." + str(handler.get_status())
        metrics.timing(metric, handler.request.request_time() * 1000.0)

        super(LoggingApplication, self).log_request(handler)
253620
def addRemoteHandlers (logger):
    
    try:
        hostname = ait.config.logging.hostname

        # Do not "remote" log to this host, as that's already covered
        # by addLocalHandlers().
        if socket.getfqdn() != hostname:
            socket.getaddrinfo(hostname, None)
            logger.addHandler( SysLogHandler( (hostname,  514) ) )

    except AttributeError:
        pass  # No ait.config.logging.hostname

    except socket.gaierror:
        pass
891894
def init_logger(log_requests=False):
    

    logger = logging.getLogger(__name__.split(".")[0])
    for handler in logger.handlers:  # pragma: nocover
        logger.removeHandler(handler)

    formatter = coloredlogs.ColoredFormatter(fmt="%(asctime)s: %(message)s")
    handler = logging.StreamHandler()
    handler.setLevel(logging.DEBUG)
    handler.setFormatter(formatter)
    logger.addHandler(handler)
    logger.setLevel(logging.DEBUG)
    logger.propagate = False

    if log_requests:
        requests.packages.urllib3.add_stderr_logger()
1326412
def remove_loghandler (handler):
    """"""
    logging.getLogger(LOG_ROOT).removeHandler(handler)
    logging.getLogger().removeHandler(handler)
668967
private void addCommonHandlers(ChannelPipeline pipeline) {
        pipeline.addLast(Constants.DECOMPRESSOR_HANDLER, new HttpContentDecompressor());
        if (httpTraceLogEnabled) {
            pipeline.addLast(Constants.HTTP_TRACE_LOG_HANDLER,
                    new HttpTraceLoggingHandler(Constants.TRACE_LOG_UPSTREAM));
        }
    }
830915
def add_file_handler(logger, logFilename=None):
    
    assert isinstance(logger, logging.Logger)
    ch = logging.FileHandler(logFilename, "a")
    # ch.setFormatter(logging._defaultFormatter) # todo may change to have same formatter as last handler of logger
    ch.setFormatter(_fmtr)
    logger.addHandler(ch)
1102641
public void setLogHandler(String id, LogHandler ref) {
        if (id != null && ref != null) {
            logHandlerServices.put(id, ref);
        }
    }