Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache license, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the license for the specific language governing permissions and
* limitations under the license.
*/
package org.apache.log4j.config;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Properties;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.core.appender.ConsoleAppender;
import org.apache.logging.log4j.core.appender.ConsoleAppender.Target;
import org.apache.logging.log4j.core.config.Configuration;
import org.apache.logging.log4j.core.config.ConfigurationFactory;
import org.apache.logging.log4j.core.config.ConfigurationSource;
import org.apache.logging.log4j.core.config.builder.api.AppenderComponentBuilder;
import org.apache.logging.log4j.core.config.builder.api.ConfigurationBuilder;
import org.apache.logging.log4j.core.config.builder.api.LayoutComponentBuilder;
import org.apache.logging.log4j.core.config.builder.impl.BuiltConfiguration;
import org.apache.logging.log4j.status.StatusLogger;
/**
* Experimental ConfigurationFactory for Log4j 1.2 properties files.
*
* Currently supports:
*
*
*
log4j.debug
*
log4j.rootLogger
*
log4j.logger
*
log4j.appender
*
org.apache.log4j.ConsoleAppender
*
org.apache.log4j.PatternLayout
*
*
Follow
*
Target
*
layout = org.apache.log4j.PatternLayout
*
layout = org.apache.log4j.SimpleLayout
*
layout = org.apache.log4j.TTCCLayout (partial)
*
layout = org.apache.log4j.HtmlLayout (partial)
*
layout = org.apache.log4j.XmlLayout (partial)
*
layout.ConversionPattern
*
*
*/
// TODO
// @Plugin(name = "Log4j1ConfigurationFactory", category = ConfigurationFactory.CATEGORY)
//
// Best Value?
// @Order(50)
public class Log4j1ConfigurationFactory extends ConfigurationFactory {
private Map buildClassToPropertyPrefixMap(final Properties properties,
final String[] sortedAppenderNames) {
final String prefix = "log4j.appender.";
final int preLength = prefix.length();
final Map map = new HashMap<>(sortedAppenderNames.length);
for (final Entry