Called at static initialization time. Selects and initializes our logging backend.
10304
protected static void initLogger ()
    {
        // if a custom class was specified as a system property, use that
        Factory factory = createConfiguredFactory();

        // create and a log4j logger if the log4j configuration system property is set
        try {
            if (factory == null && System.getProperty("log4j.configuration") != null) {
                factory = (Factory)Class.forName("com.samskivert.util.Log4JLogger").newInstance();
            }
        } catch (SecurityException se) {
            // in a sandbox, no biggie
        } catch (Throwable t) {
            System.err.println("Unable to instantiate Log4JLogger: " + t);
        }

        // create and a log4j2 logger if the log4j2 configuration system property is set
        try {
            if (factory == null && System.getProperty("log4j.configurationFile") != null) {
                factory = (Factory)Class.forName("com.samskivert.util.Log4J2Logger").newInstance();
            }
        } catch (SecurityException se) {
            // in a sandbox, no biggie
        } catch (Throwable t) {
            System.err.println("Unable to instantiate Log4J2Logger: " + t);
        }

        // lastly, fall back to the Java logging system
        if (factory == null) {
            factory = new JDK14Logger();
        }

        // and finally configure our factory
        setFactory(factory);
    }
823708
static function init(){
		
		// Start error handling asap
		self::set_error_handlers();
		// PLUG_ERROR_REPORTING should be set in conf
		if( defined('PLUG_ERROR_REPORTING') ){
			error_reporting( PLUG_ERROR_REPORTING );
		}
		else {
			define('PLUG_ERROR_REPORTING', error_reporting() );
		}
		
		// Select execution mode ( Server | Command line interface )
		if( defined('PLUG_CLI') ){
			// PLUGCli must have been included to define this constant
			PLUGCli::init();
		}
		else {
			// Default to server module mode
			// already checked PHP_SAPI
			define( 'PLUG_CLI', false );
		}
	}
998212
def init_log(log_level):
    """"""
    log_level = log_level or "INFO"
    logging.basicConfig(
        format="%(name)s:%(levelname)s:%(message)s",
        level=getattr(logging, log_level.upper(), logging.INFO),
    )
563819
static void init() {// NOPMD

		determineIfNTEventLogIsSupported();

		URL resource = null;

		final String configurationOptionStr = OptionConverter.getSystemProperty(DEFAULT_CONFIGURATION_KEY, null);

		if (configurationOptionStr != null) {
			try {
				resource = new URL(configurationOptionStr);
			} catch (MalformedURLException ex) {
				// so, resource is not a URL:
				// attempt to get the resource from the class path
				resource = Loader.getResource(configurationOptionStr);
			}
		}
		if (resource == null) {
			resource = Loader.getResource(DEFAULT_CONFIGURATION_FILE); // NOPMD
		}

		if (resource == null) {
			System.err.println("[FoundationLogger] Can not find resource: " + DEFAULT_CONFIGURATION_FILE); // NOPMD
			throw new FoundationIOException("Can not find resource: " + DEFAULT_CONFIGURATION_FILE); // NOPMD
		}

		// update the log manager to use the Foundation repository.
		final RepositorySelector foundationRepositorySelector = new FoundationRepositorySelector(FoundationLogFactory.foundationLogHierarchy);
		LogManager.setRepositorySelector(foundationRepositorySelector, null);

		// set logger to info so we always want to see these logs even if root
		// is set to ERROR.
		final Logger logger = getLogger(FoundationLogger.class);

		final String logPropFile = resource.getPath();
		log4jConfigProps = getLogProperties(resource);
		
		// select and configure again so the loggers are created with the right
		// level after the repository selector was updated.
		OptionConverter.selectAndConfigure(resource, null, FoundationLogFactory.foundationLogHierarchy);

		// start watching for property changes
		setUpPropFileReloading(logger, logPropFile, log4jConfigProps);

		// add syslog appender or windows event viewer appender
//		setupOSSystemLog(logger, log4jConfigProps);

		// parseMarkerPatterns(log4jConfigProps);
		// parseMarkerPurePattern(log4jConfigProps);
//		udpateMarkerStructuredLogOverrideMap(logger);

        AbstractFoundationLoggingMarker.init();

		updateSniffingLoggersLevel(logger);

        setupJULSupport(resource);

    }
735099
@PostConstruct
    public final void init() {
        this.cleanUpTimer = Executors.newScheduledThreadPool(1, timerTask -> {
            final Thread thread = new Thread(timerTask, "Clean up old job records");
            thread.setDaemon(true);
            return thread;
        });
        this.cleanUpTimer.scheduleAtFixedRate(this::cleanup, this.cleanupInterval, this.cleanupInterval,
                                              TimeUnit.SECONDS);
    }
1067638
private function startLogging()
    {
        $this->loggingStart = round(microtime(true) * 1000);
        $this->lastLog = $this->loggingStart;
    }
1031531
private void initLogThreshold(Long threshold) {
		this.logThreshold = threshold;
		final LogTemplate<Split> toLogger = toSLF4J(getClass().getName(), "debug");
		if (threshold == null) {
			callTreeLogTemplate = toLogger;
		} else {
			callTreeLogTemplate = whenSplitLongerThanMilliseconds(toLogger, threshold);
		}
	}
1278008
def init_logger():
    
    import logging as _logging
    import logging.config

    # Package level logger
    _logging.config.dictConfig({
        'version': 1,
        'disable_existing_loggers': False,
        'formatters': {
            'standard': {
                'format': '%(asctime)s [%(levelname)s] %(name)s, %(lineno)s: %(message)s'
            },
            'brief': {
                'format': '[%(levelname)s] %(name)s: %(message)s'
            }
        },
        'handlers': {
            'default': {
                'class': 'logging.StreamHandler',
                'formatter': 'brief'
            },
            'file': {
                'class': 'logging.FileHandler',
                'formatter': 'standard',
                'filename': _client_log_file,
                'encoding': 'UTF-8',
                'delay': 'False',
            }
        },
        'loggers': {
            _root_package_name: {
                'handlers': ['default', 'file'],
                'propagate': 'True'
            }
        }
    })

    # Set module specific log levels
    _logging.getLogger('requests').setLevel(_logging.CRITICAL)
    if _i_am_a_lambda_worker():
        _logging.getLogger(_root_package_name).setLevel(_logging.WARNING)
    else:
        _logging.getLogger(_root_package_name).setLevel(_logging.INFO)
928555
public void init ()
    {
        try {
            if (!Boolean.getBoolean("com.samskivert.util.JDK14Logger.noFormatter")) {
                OneLineLogFormatter.configureDefaultHandler();
            }
            boolean reportedUTF8Missing = false;
            for (Handler handler : java.util.logging.Logger.getLogger("").getHandlers()) {
                try {
                    handler.setEncoding("UTF-8");
                } catch (UnsupportedEncodingException e) {
                    // JVMs are required to support UTF-8 so this shouldn't happen, but if it does,
                    // tell somebody that things are really fucked
                    if (!reportedUTF8Missing) {
                        reportedUTF8Missing = true;
                        System.err.println("Unable to find UTF-8 encoding. " +
                                           "This JVM ain't right: " + e.getMessage());
                    }
                }
            }
        } catch (SecurityException se) {
            // running in sandbox; no custom logging; no problem!
        }
    }
625322
protected function initialize()
    {
        if ($this->initialized === true) {
            return;
        }
        $this->initialized = true;
        $this->buildFullConfiguration();
        $this->applyPostprocessing();
    }
255898
protected static function init()
    {
        set_error_handler(function($code, $msg, $file, $line){
            Worker::safeEcho("$msg in file $file on line $line\n");
        });

        // Start file.
        $backtrace        = debug_backtrace();
        static::$_startFile = $backtrace[count($backtrace) - 1]['file'];


        $unique_prefix = str_replace('/', '_', static::$_startFile);

        // Pid file.
        if (empty(static::$pidFile)) {
            static::$pidFile = __DIR__ . "/../$unique_prefix.pid";
        }

        // Log file.
        if (empty(static::$logFile)) {
            static::$logFile = __DIR__ . '/../workerman.log';
        }
        $log_file = (string)static::$logFile;
        if (!is_file($log_file)) {
            touch($log_file);
            chmod($log_file, 0622);
        }

        // State.
        static::$_status = static::STATUS_STARTING;

        // For statistics.
        static::$_globalStatistics['start_timestamp'] = time();
        static::$_statisticsFile                      = sys_get_temp_dir() . "/$unique_prefix.status";

        // Process title.
        static::setProcessTitle('WorkerMan: master process  start_file=' . static::$_startFile);

        // Init data for worker id.
        static::initId();

        // Timer init.
        Timer::init();
    }
347823
def initLogging(self):
        """"""
        verbose_levels = {
            0: logging.WARNING,
            1: logging.INFO,
            2: logging.DEBUG,
        }
        logging.basicConfig(
            level=verbose_levels[self.verbose],
            format="[%(asctime)-15s] %(module)-9s %(levelname)-7s %(message)s"
        )
        return logging.getLogger(self.__class__.__name__)
534110
private static void initializeLogFactory() {
    ServiceLoader<LogFactory> loader = ServiceLoader.load(LogFactory.class);
    for (LogFactory lf : loader) {
      logFactory = lf;
      log("New instance, using: " + logFactory.getClass().getName());
      return;
    }
    try {
      final org.slf4j.ILoggerFactory lf = org.slf4j.LoggerFactory.getILoggerFactory();
      logFactory = new LogFactory() {
        @Override
        public Log getLog(String s) {
          return new Slf4jLogger(lf.getLogger(s));
        }
      };
      log("New instance, using SLF4J logging");
      return;
    } catch (NoClassDefFoundError ignore) {
    }
    try {
      final org.apache.commons.logging.LogFactory cl =
        org.apache.commons.logging.LogFactory.getFactory();
      logFactory = new LogFactory() {
        @Override
        public Log getLog(String s) {
          return new CommonsLogger(cl.getInstance(s));
        }
      };
      log("New instance, using commons logging");
      return;
    } catch (NoClassDefFoundError ignore) {
    }
    logFactory = new LogFactory() {
      @Override
      public Log getLog(String s) {
        return new JdkLogger(Logger.getLogger(s));
      }
    };
    log("New instance, using JDK logging");
  }
936787
public void init() {
        if (logger != null && StringUtils.isNotEmpty(name)) {
            if (logger.isWarnEnabled() && !ConfigUtils.isFilePath(name)) {
                try {
                    List<String> realPaths = new ArrayList<String>();
                    Enumeration<URL> e = Thread.currentThread().getContextClassLoader().getResources(name);
                    while (e.hasMoreElements()) {
                        URL url = (URL) e.nextElement();
                        realPaths.add(url.getFile());
                    }
                    if (realPaths.size() > 1) {
                        logger.warn("Multi httl config in classpath, conflict configs: " + realPaths + ". Please keep only one config.");
                    }
                } catch (IOException e) {
                    logger.error(e.getMessage(), e);
                }
            }
            if (logger.isInfoEnabled()) {
                String realPath = ConfigUtils.getRealPath(name);
                if (StringUtils.isNotEmpty(realPath)) {
                    logger.info("Load httl config from " + realPath + " in " + (name.startsWith("/") ? "filesystem" : "classpath") + ".");
                }
            }
        }
    }
310635
public static void init()
  {
    try {
      initializeEnvironment();
    } catch (Throwable e) {
      log().log(Level.FINER, e.toString(), e);
    }

    try {
      init(Thread.currentThread().getContextClassLoader());
    } catch (Throwable e) {
      log().log(Level.FINER, e.toString(), e);
    }
  }
528227
def initLogger():
    '''
    
    '''
    global logger
    logger = logging.getLogger('root')
    logger.setLevel(logging.DEBUG)
    ch = logging.StreamHandler(sys.stdout)
    ch.setLevel(logging.INFO)
    formatter = logging.Formatter("[%(asctime)s] %(levelname)s: %(message)s", "%Y-%m-%d %H:%M:%S")
    ch.setFormatter(formatter)
    logger.addHandler(ch)
1225029
def initialize_logging(args):
    """"""
    log_handler = logging.StreamHandler()
    log_formatter = logging.Formatter(
        "%(levelname)s %(asctime)s %(name)s:%(lineno)04d - %(message)s")
    log_handler.setFormatter(log_formatter)

    root_logger = logging.getLogger()
    root_logger.addHandler(log_handler)
    root_logger.setLevel(getattr(logging, args.loglevel))