Initialization of log4j <br>
<b>NOTE</b>  - if log4j property file is called log4j.properties then
log4j will be configured already.
7283
private static synchronized void initializeLog4JSubSystem(String configFile)
    {
        LoggerFactory.getBootLogger().info("Initializing Log4J using file: '" + configFile + "'");
        if(configFile == null || "".equals(configFile.trim()))
        {
            // no configuration available
            LoggerFactory.getBootLogger().warn("No log4j configuration file specified");
        }
        else
        {
            // try resource look in classpath
            URL url = ClassHelper.getResource(configFile);
            LoggerFactory.getBootLogger().info("Initializing Log4J : resource from config file:" + url);
            if (url != null)
            {
                PropertyConfigurator.configure(url);
            }
            // if file is not in classpath try ordinary filesystem lookup
            else
            {
                PropertyConfigurator.configure(configFile);
            }
        }
        log4jConfigured = true;
    }
542068
private void initOut() throws IOException
   {
      if (out == null)
      {
         FileOutputStream os = PrivilegedFileHelper.fileOutputStream(logFile, false);
         out = os.getChannel();
      }
   }
977819
static void createLoggingPropertiesFile(InstanceType type) throws IOException {
        LOGGER.entering(type);

        String installedFile = LOGGING_PROPERTIES_FILE + "." + type.getFriendlyName();
        if (!new File(installedFile).exists()) {

            // Need to change the backward slash to forward, so that logger able to locate path in windows
            String logPath = LOGS_DIR.replace("\\", "/");

            String value = IOUtils.toString(JarSpawner.class.getResourceAsStream(LOGGING_PROPERTIES_FILE_RESOURCE),
                    "UTF-8");
            value = value.concat("\njava.util.logging.FileHandler.pattern=" + logPath + "selion-grid-" + type.getFriendlyName()
                    + "-%g.log");
            FileUtils.writeStringToFile(new File(installedFile), value, "UTF-8");
            LOGGER.fine("Logger file created successfully. Path is " + installedFile);
        }

        LOGGER.exiting();
    }
845952
private static void initializePropertiesIfNeeded() {
        if (translationResources != null) {
            return;
        }
        String lastException = "";
        try {
            translationResources = new Properties();
            ClassLoader classLoader = ClassLoader.getSystemClassLoader();
            translationResources.load(classLoader.getResourceAsStream(
                    propertiesFileName));
        } catch (Exception exception) {
            lastException = exception.toString() + "\n----\n" + exception.getMessage();
        }
        if (translationResources == null) {
            throw new RuntimeException("TranslationSource.initializePropertiesIfNeeded()"
                    + "Could not load TranslationResources.properties file.\n"
                    + "The exception follows:\n" + lastException);
        }
    }
261903
@Override
    public void init(RuntimeServices rs) {
        String name = (String) rs.getProperty(LOGCHUTE_SLF4J_NAME);

        if (name == null) {
            name = DEFAULT_LOG_NAME;
        }
        log = LoggerFactory.getLogger(name);
        log(LogChute.DEBUG_ID, "Slf4jLogChute name is '" + name + "'");
    }
119133
private void init() {
        boolean success = false;
        // If JAXP is prefered (comes with Sun JVM 1.4.0 and higher)
        if (!success) {
            try {
                javax.xml.parsers.SAXParserFactory spf = javax.xml.parsers.SAXParserFactory.newInstance();
                spf.setNamespaceAware(true);
                javax.xml.parsers.SAXParser saxParser = spf.newSAXParser();
                parser = saxParser.getXMLReader();
                logger.info("Using JAXP/SAX XML parser.");
                success = true;
            } catch (ParserConfigurationException | SAXException e) {
                logger.warn("Could not instantiate JAXP/SAX XML reader!");
                logger.debug(e);
            }
        }
        // Aelfred is first alternative.
        if (!success) {
            try {
                parser = (XMLReader) this.getClass().getClassLoader().loadClass("gnu.xml.aelfred2.XmlReader")
                        .newInstance();
                logger.info("Using Aelfred2 XML parser.");
                success = true;
            } catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
                logger.warn("Could not instantiate Aelfred2 XML reader!");
                logger.debug(e);
            }
        }
        // Xerces is second alternative
        if (!success) {
            try {
                parser = (XMLReader) this.getClass().getClassLoader().loadClass("org.apache.xerces.parsers.SAXParser")
                        .newInstance();
                logger.info("Using Xerces XML parser.");
                success = true;
            } catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
                logger.warn("Could not instantiate Xerces XML reader!");
                logger.debug(e);
            }
        }
        if (!success) {
            logger.error("Could not instantiate any XML parser!");
        }
    }
594134
public synchronized static void initConfig(Map<ConfigProperty, String> initialValues) {
        SeLionLogger.getLogger().entering(initialValues);

        // only do this if the global config is not already initialized.
        if (xmlConfig == null) {
            xmlConfig = new XMLConfiguration();
            // don't auto throw, let each config value decide
            xmlConfig.setThrowExceptionOnMissing(false);
            // because we can config on the fly, don't auto-save
            xmlConfig.setAutoSave(false);

            // Set defaults
            loadInitialValues();
        }

        /*
         * otherwise, update the global config
         */

        // Load in our supplied values (if defined)
        loadValuesFromUser(initialValues);

        // Load in environment & system variables (if defined)
        loadValuesFromEnvironment();

        // Init Selenium configuration
        boolean runLocally = xmlConfig.getBoolean(ConfigProperty.SELENIUM_RUN_LOCALLY.getName());
        if (runLocally) {
            xmlConfig.setProperty(ConfigProperty.SELENIUM_HOST.getName(), "localhost");
        }

        SeLionLogger.getLogger().exiting();
    }
1207875
@Override
	protected void initializeJawrConfig(Properties props) throws ServletException {

		StopWatch stopWatch = new StopWatch("Jawr Processing for '" + resourceType + "' resource");
		ThreadLocalJawrContext.setStopWatch(stopWatch);
		stopWatch.start("Initialize jawr config for binary resource handler");
		if (this.binaryMimeTypeMap == null) {
			this.binaryMimeTypeMap = MIMETypesSupport.getSupportedProperties(this);
		}

		// init registry
		generatorRegistry = new GeneratorRegistry(resourceType);

		// Initialize config
		if (null != jawrConfig) {
			jawrConfig.invalidate();
		}

		jawrConfig = createJawrConfig(props);

		jawrConfig.setContext(servletContext);
		jawrConfig.setGeneratorRegistry(generatorRegistry);

		// Set mapping, to be used by the tag lib to define URLs that point to
		// this servlet.
		String mapping = (String) initParameters.get(JawrConstant.SERVLET_MAPPING_PROPERTY_NAME);
		if (null != mapping) {
			jawrConfig.setServletMapping(mapping);
		}

		// Initialize the IllegalBundleRequest handler
		initIllegalBundleRequestHandler();

		// Initialize the resource handler
		rsReaderHandler = initResourceReaderHandler();
		rsBundleHandler = initResourceBundleHandler();

		// Initialize custom generators
		PropertiesConfigHelper propertiesHelper = new PropertiesConfigHelper(props, resourceType);
		Iterator<String> generators = propertiesHelper
				.getCommonPropertyAsSet(PropertiesBundleConstant.CUSTOM_GENERATORS).iterator();
		while (generators.hasNext()) {
			String generatorClass = (String) generators.next();
			generatorRegistry.registerGenerator(generatorClass);
		}

		if (jawrConfig.getUseBundleMapping()) {
			bundleMapping = rsBundleHandler.getJawrBundleMapping();
		} else {
			bundleMapping = new Properties();
		}
		stopWatch.stop();
		stopWatch.start("initialize mapping for binary resource handler");
		binaryRsHandler = new BinaryResourcesHandler(jawrConfig, rsReaderHandler, rsBundleHandler);
		initMapping(binaryRsHandler);

		servletContext.setAttribute(JawrConstant.BINARY_CONTEXT_ATTRIBUTE, binaryRsHandler);

		if (LOGGER.isDebugEnabled()) {
			LOGGER.debug("Configuration read. Current config:");
			LOGGER.debug(jawrConfig.toString());
		}

		stopWatch.stop();
		stopWatch.start("initialize mapping for binary resource handler");
		if (PERF_PROCESSING_LOGGER.isDebugEnabled()) {
			PERF_PROCESSING_LOGGER.debug(stopWatch.prettyPrint());
		}
		// Warn when in debug mode
		if (jawrConfig.isDebugModeOn()) {
			LOGGER.warn(
					"Jawr initialized in DEVELOPMENT MODE. Do NOT use this mode in production or integration servers. ");
		}
		stopWatch.stop();
		if (PERF_PROCESSING_LOGGER.isDebugEnabled()) {
			PERF_PROCESSING_LOGGER.debug(stopWatch.prettyPrint());
		}
	}
896356
private function initializeLogFile()
    {
        $this->log = $this->dir.'/builds.log';

        if (!file_exists($this->log)) {
            $data = array(
                'last_update' => null,
                'projects'    => array(),
            );

            file_put_contents($this->log, serialize($data));
        }
    }
738458
@Override
    public void configure() {
        if (getProperties().containsKey(PROPERTY_NAME_FILE_PATTERN)) {
            filePattern = Pattern.compile(getProperties().get(PROPERTY_NAME_FILE_PATTERN).toString());
        } else {
            filePattern = Pattern.compile(DEFAULT_FILE_PATTERN);
        }
    }
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");
  }
1087063
public void contextInitialized(ServletContextEvent sce) {
    	LogLog.debug("Start to initialize log4j");

    	LogLog.debug("Confige CXF to use log4j!");

    	ServletContext sc = sce.getServletContext();
        if (Log4jWebUtils.isWatchDisabled(sc)) {
            Log4jWebUtils.reload(sc);
        } else {
            Log4jWebUtils.reloadAndWatch(sc, Log4jWebUtils.getWatchDelay(sc));
        }
        logger.info("Log4j initialized...");
    }
483570
private void createIzouPropertiesFile() {
        String propertiesPath = getMain().getFileSystemManager().getPropertiesLocation() + File.separator
                + IZOU_PROPERTIES_FILE_NAME;

        propertiesFile = new File(propertiesPath);
        if (!propertiesFile.exists()) try (PrintWriter writer = new PrintWriter(propertiesFile.getAbsolutePath(), "UTF-8")) {
            propertiesFile.createNewFile();

            writer.println("# --------------------");
            writer.println("# Izou Properties File");
            writer.println("# --------------------");
            writer.println("#");
            writer.println("# This file has some general configuration options that have to be configured before");
            writer.println("# Izou can run successfully.");
        } catch (IOException e) {
            error("Error while trying to create the new Properties file", e);
        }
    }
793418
private static void initLogFile() {
    try (BufferedWriter bw = new BufferedWriter(new FileWriter(getLogPath()))) {
      Date date = new Date();
      bw.write("LT office integration log from " + date.toString() + logLineBreak);
    } catch (Throwable t) {
      showError(t);
    }
  }
1236615
private void initialize(@NotNull final String propertiesFilePath) {
        props = new Properties();
        try (InputStream in = FileUtils.getResourceAsStream(propertiesFilePath)) {
            props.load(in);
        } catch (NullPointerException ex) {
            LOGGER.error("Did not find settings file '{}'.", propertiesFilePath);
            LOGGER.debug("", ex);
        } catch (IOException ex) {
            LOGGER.error("Unable to load settings from '{}'.", propertiesFilePath);
            LOGGER.debug("", ex);
        }
        logProperties("Properties loaded", props);
    }
250581
public void setSlf4jLogname(String logName)
    {
        // use length() == 0 instead of isEmpty() for Java 5 compatibility
        if( logName.length() == 0 )
        {
            m_log = null;
        }
        else
        {
            m_log = LoggerFactory.getLogger(logName);
        }
    }
687705
public void initialize(PropertyProvider propertyProvider) {

        host = propertyProvider.getProperty(PropertyProvider.PROPERTY_HOST);
        if (host == null) {
            host = propertyProvider.getProperty(PropertyProvider.PROPERTY_GRAYLOG_HOST);
        }

        String port = propertyProvider.getProperty(PropertyProvider.PROPERTY_PORT);
        if (port == null) {
            port = propertyProvider.getProperty(PropertyProvider.PROPERTY_GRAYLOG_PORT);
        }

        if (port != null && !"".equals(port)) {
            this.port = Integer.parseInt(port);
        }

        originHost = propertyProvider.getProperty(PropertyProvider.PROPERTY_ORIGIN_HOST);
        setExtractStackTrace(propertyProvider.getProperty(PropertyProvider.PROPERTY_EXTRACT_STACKTRACE));
        setFilterStackTrace("true".equalsIgnoreCase(propertyProvider.getProperty(PropertyProvider.PROPERTY_FILTER_STACK_TRACE)));

        String includeLogMessageParameters = propertyProvider
                .getProperty(PropertyProvider.PROPERTY_INCLUDE_LOG_MESSAGE_PARAMETERS);
        if (includeLogMessageParameters != null && !includeLogMessageParameters.trim().equals("")) {
            setIncludeLogMessageParameters("true".equalsIgnoreCase(includeLogMessageParameters));
        }

        setupStaticFields(propertyProvider);
        setupAdditionalFieldTypes(propertyProvider);
        facility = propertyProvider.getProperty(PropertyProvider.PROPERTY_FACILITY);
        String version = propertyProvider.getProperty(PropertyProvider.PROPERTY_VERSION);

        if (version != null && !"".equals(version)) {
            this.version = version;
        }

        String messageSize = propertyProvider.getProperty(PropertyProvider.PROPERTY_MAX_MESSAGE_SIZE);
        if (messageSize != null) {
            maximumMessageSize = Integer.parseInt(messageSize);
        }

        String timestampPattern = propertyProvider.getProperty(PropertyProvider.PROPERTY_TIMESTAMP_PATTERN);
        if (timestampPattern != null && !"".equals(timestampPattern)) {
            this.timestampPattern = timestampPattern;
        }
    }