Return-Path: X-Original-To: apmail-logging-commits-archive@minotaur.apache.org Delivered-To: apmail-logging-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C83A89BEB for ; Fri, 30 Dec 2011 06:13:41 +0000 (UTC) Received: (qmail 18941 invoked by uid 500); 30 Dec 2011 06:13:41 -0000 Delivered-To: apmail-logging-commits-archive@logging.apache.org Received: (qmail 18877 invoked by uid 500); 30 Dec 2011 06:13:39 -0000 Mailing-List: contact commits-help@logging.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@logging.apache.org Delivered-To: mailing list commits@logging.apache.org Received: (qmail 18855 invoked by uid 99); 30 Dec 2011 06:13:36 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Dec 2011 06:13:36 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Dec 2011 06:13:29 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 9AD4823888E7; Fri, 30 Dec 2011 06:13:07 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1225762 [2/2] - in /logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src: main/java/org/apache/logging/log4j/core/layout/ main/java/org/apache/logging/log4j/core/lookup/ main/java/org/apache/logging/log4j/core/net/ main/ja... Date: Fri, 30 Dec 2011 06:13:05 -0000 To: commits@logging.apache.org From: rgoers@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111230061307.9AD4823888E7@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/RegexReplacement.java URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/RegexReplacement.java?rev=1225762&r1=1225761&r2=1225762&view=diff ============================================================================== --- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/RegexReplacement.java (original) +++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/RegexReplacement.java Fri Dec 30 06:13:04 2011 @@ -1,20 +1,19 @@ /* * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with + * 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 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 + * 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. + * See the license for the specific language governing permissions and + * limitations under the license. */ - package org.apache.logging.log4j.core.pattern; import org.apache.logging.log4j.Logger; @@ -31,12 +30,12 @@ import java.util.regex.Pattern; @Plugin(name = "replace", type = "Core", printObject = true) public final class RegexReplacement { + private static final Logger LOGGER = StatusLogger.getLogger(); + private final Pattern pattern; private final String substitution; - private static Logger logger = StatusLogger.getLogger(); - /** * Private constructor. * @@ -71,11 +70,11 @@ public final class RegexReplacement { public static RegexReplacement createRegexReplacement(@PluginAttr("regex") String regex, @PluginAttr("replacement") String replacement) { if (regex == null) { - logger.error("A regular expression is required for replacement"); + LOGGER.error("A regular expression is required for replacement"); return null; } if (replacement == null) { - logger.error("A replacement string is required to perform replacement"); + LOGGER.error("A replacement string is required to perform replacement"); } Pattern p = Pattern.compile(regex); return new RegexReplacement(p, replacement); Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/RegexReplacementConverter.java URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/RegexReplacementConverter.java?rev=1225762&r1=1225761&r2=1225762&view=diff ============================================================================== --- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/RegexReplacementConverter.java (original) +++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/RegexReplacementConverter.java Fri Dec 30 06:13:04 2011 @@ -1,28 +1,25 @@ /* * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with + * 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 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 + * 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. + * See the license for the specific language governing permissions and + * limitations under the license. */ - package org.apache.logging.log4j.core.pattern; -import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.core.LogEvent; import org.apache.logging.log4j.core.config.Configuration; import org.apache.logging.log4j.core.config.plugins.Plugin; import org.apache.logging.log4j.core.layout.PatternLayout; -import org.apache.logging.log4j.status.StatusLogger; import java.util.List; import java.util.regex.Pattern; @@ -31,15 +28,13 @@ import java.util.regex.Pattern; * Replacement pattern converter. */ @Plugin(name = "replace", type = "Converter") -@ConverterKeys({"replace"}) +@ConverterKeys({"replace" }) public final class RegexReplacementConverter extends LogEventPatternConverter { private final Pattern pattern; private final String substitution; - private static final Logger LOGGER = StatusLogger.getLogger(); - private List converters; /** Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/RelativeTimePatternConverter.java URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/RelativeTimePatternConverter.java?rev=1225762&r1=1225761&r2=1225762&view=diff ============================================================================== --- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/RelativeTimePatternConverter.java (original) +++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/RelativeTimePatternConverter.java Fri Dec 30 06:13:04 2011 @@ -1,20 +1,19 @@ /* * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with + * 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 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 + * 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. + * See the license for the specific language governing permissions and + * limitations under the license. */ - package org.apache.logging.log4j.core.pattern; import org.apache.logging.log4j.core.LogEvent; @@ -26,7 +25,7 @@ import java.lang.management.ManagementFa * Return the relative time in milliseconds since JVM Startup. */ @Plugin(name = "RelativeTimePatternConverter", type = "Converter") -@ConverterKeys({"r", "relative"}) +@ConverterKeys({"r", "relative" }) public class RelativeTimePatternConverter extends LogEventPatternConverter { /** * Cached formatted timestamp. Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/RootThrowablePatternConverter.java URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/RootThrowablePatternConverter.java?rev=1225762&r1=1225761&r2=1225762&view=diff ============================================================================== --- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/RootThrowablePatternConverter.java (original) +++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/RootThrowablePatternConverter.java Fri Dec 30 06:13:04 2011 @@ -1,20 +1,19 @@ /* * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with + * 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 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 + * 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. + * See the license for the specific language governing permissions and + * limitations under the license. */ - package org.apache.logging.log4j.core.pattern; import org.apache.logging.log4j.core.LogEvent; @@ -31,8 +30,8 @@ import org.apache.logging.log4j.core.imp * version of the jar if available. */ @Plugin(name = "RootThrowablePatternConverter", type = "Converter") -@ConverterKeys({"rEx", "rThrowable", "rException"}) -public class RootThrowablePatternConverter extends ThrowablePatternConverter { +@ConverterKeys({"rEx", "rThrowable", "rException" }) +public final class RootThrowablePatternConverter extends ThrowablePatternConverter { /** * Private constructor. * Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/SequenceNumberPatternConverter.java URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/SequenceNumberPatternConverter.java?rev=1225762&r1=1225761&r2=1225762&view=diff ============================================================================== --- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/SequenceNumberPatternConverter.java (original) +++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/SequenceNumberPatternConverter.java Fri Dec 30 06:13:04 2011 @@ -1,20 +1,19 @@ /* * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with + * 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 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 + * 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. + * See the license for the specific language governing permissions and + * limitations under the license. */ - package org.apache.logging.log4j.core.pattern; import org.apache.logging.log4j.core.LogEvent; @@ -27,8 +26,8 @@ import java.util.concurrent.atomic.Atomi * Formats the event sequence number. */ @Plugin(name = "SequenceNumberPatternConverter", type = "Converter") -@ConverterKeys({"sn", "sequenceNumber"}) -public class SequenceNumberPatternConverter extends LogEventPatternConverter { +@ConverterKeys({"sn", "sequenceNumber" }) +public final class SequenceNumberPatternConverter extends LogEventPatternConverter { private static AtomicLong sequence = new AtomicLong(); /** * Singleton. Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/ThreadPatternConverter.java URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/ThreadPatternConverter.java?rev=1225762&r1=1225761&r2=1225762&view=diff ============================================================================== --- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/ThreadPatternConverter.java (original) +++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/ThreadPatternConverter.java Fri Dec 30 06:13:04 2011 @@ -1,20 +1,19 @@ /* * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with + * 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 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 + * 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. + * See the license for the specific language governing permissions and + * limitations under the license. */ - package org.apache.logging.log4j.core.pattern; import org.apache.logging.log4j.core.LogEvent; @@ -24,8 +23,8 @@ import org.apache.logging.log4j.core.con * Formats the event thread name. */ @Plugin(name = "ThreadPatternConverter", type = "Converter") -@ConverterKeys({"t", "thread"}) -public class ThreadPatternConverter extends LogEventPatternConverter { +@ConverterKeys({"t", "thread" }) +public final class ThreadPatternConverter extends LogEventPatternConverter { /** * Singleton. */ Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/ThrowablePatternConverter.java URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/ThrowablePatternConverter.java?rev=1225762&r1=1225761&r2=1225762&view=diff ============================================================================== --- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/ThrowablePatternConverter.java (original) +++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/ThrowablePatternConverter.java Fri Dec 30 06:13:04 2011 @@ -1,20 +1,19 @@ /* * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with + * 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 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 + * 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. + * See the license for the specific language governing permissions and + * limitations under the license. */ - package org.apache.logging.log4j.core.pattern; import org.apache.logging.log4j.core.LogEvent; @@ -30,8 +29,17 @@ import java.io.StringWriter; * the number of lines to print is explicitly specified. */ @Plugin(name = "ThrowablePatternConverter", type = "Converter") -@ConverterKeys({"ex", "throwable", "exception"}) +@ConverterKeys({"ex", "throwable", "exception" }) public class ThrowablePatternConverter extends LogEventPatternConverter { + + /** + * Format the whole stack trace. + */ + protected static final String FULL = "full"; + /** + * Format only the first line of the throwable. + */ + protected static final String SHORT = "short"; /** * If "short", only first line of throwable report will be formatted.
* If "full", the whole stack trace will be formatted.
@@ -39,9 +47,9 @@ public class ThrowablePatternConverter e */ protected final String option; - protected static final String FULL = "full"; - protected static final String SHORT = "short"; - + /** + * The number of lines to write. + */ protected final int lines; /** Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/UUIDPatternConverter.java URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/UUIDPatternConverter.java?rev=1225762&r1=1225761&r2=1225762&view=diff ============================================================================== --- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/UUIDPatternConverter.java (original) +++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/pattern/UUIDPatternConverter.java Fri Dec 30 06:13:04 2011 @@ -1,42 +1,36 @@ /* * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with + * 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 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 + * 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. + * See the license for the specific language governing permissions and + * limitations under the license. */ - package org.apache.logging.log4j.core.pattern; -import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.core.LogEvent; import org.apache.logging.log4j.core.config.plugins.Plugin; import org.apache.logging.log4j.core.helpers.UUIDUtil; -import org.apache.logging.log4j.status.StatusLogger; import java.util.UUID; - /** * Formats the event sequence number. */ @Plugin(name = "UUIDPatternConverter", type = "Converter") -@ConverterKeys({"u", "uuid"}) -public class UUIDPatternConverter extends LogEventPatternConverter { +@ConverterKeys({"u", "uuid" }) +public final class UUIDPatternConverter extends LogEventPatternConverter { private final boolean isRandom; - private static Logger logger = StatusLogger.getLogger(); - /** * Private constructor. */ @@ -57,7 +51,7 @@ public class UUIDPatternConverter extend } if (options.length > 1 || (!options[0].equalsIgnoreCase("RANDOM") && !options[0].equalsIgnoreCase("Time"))) { - logger.error("UUID Pattern Converter only accepts a single option with the value \"RANDOM\" or \"TIME\""); + LOGGER.error("UUID Pattern Converter only accepts a single option with the value \"RANDOM\" or \"TIME\""); } return new UUIDPatternConverter(options[0].equalsIgnoreCase("RANDOM")); } Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/selector/BasicContextSelector.java URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/selector/BasicContextSelector.java?rev=1225762&r1=1225761&r2=1225762&view=diff ============================================================================== --- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/selector/BasicContextSelector.java (original) +++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/selector/BasicContextSelector.java Fri Dec 30 06:13:04 2011 @@ -24,13 +24,13 @@ import java.util.Collections; import java.util.List; /** - * + * Returns either this Thread's context or the default LoggerContext. */ public class BasicContextSelector implements ContextSelector { private static LoggerContext context = new LoggerContext("Default"); - public LoggerContext getContext(String FQCN, boolean currentContext) { + public LoggerContext getContext(String fqcn, boolean currentContext) { LoggerContext ctx = ContextAnchor.THREAD_CONTEXT.get(); return ctx != null ? ctx : context; Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/selector/ClassLoaderContextSelector.java URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/selector/ClassLoaderContextSelector.java?rev=1225762&r1=1225761&r2=1225762&view=diff ============================================================================== --- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/selector/ClassLoaderContextSelector.java (original) +++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/selector/ClassLoaderContextSelector.java Fri Dec 30 06:13:04 2011 @@ -207,6 +207,9 @@ public class ClassLoaderContextSelector return context.get(); } + /** + * SecurityManager that will locate the caller of the Log4j2 API. + */ private static class PrivateSecurityManager extends SecurityManager { public Class getCaller(String fqcn) { Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/selector/ContextSelector.java URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/selector/ContextSelector.java?rev=1225762&r1=1225761&r2=1225762&view=diff ============================================================================== --- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/selector/ContextSelector.java (original) +++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/selector/ContextSelector.java Fri Dec 30 06:13:04 2011 @@ -27,12 +27,12 @@ public interface ContextSelector { /** * Return the LoggerContext. - * @param FQCN The fully qualified class name of the caller. + * @param fqcn The fully qualified class name of the caller. * @param currentContext If true returns the current Context, if false returns the Context appropriate * for the caller if a more appropriate Context can be determined. * @return The LoggerContext. */ - LoggerContext getContext(String FQCN, boolean currentContext); + LoggerContext getContext(String fqcn, boolean currentContext); /** * Return a List of all the available LoggerContexts. Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/selector/JNDIContextSelector.java URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/selector/JNDIContextSelector.java?rev=1225762&r1=1225761&r2=1225762&view=diff ============================================================================== --- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/selector/JNDIContextSelector.java (original) +++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/selector/JNDIContextSelector.java Fri Dec 30 06:13:04 2011 @@ -91,9 +91,9 @@ public class JNDIContextSelector impleme private static ConcurrentMap contextMap = new ConcurrentHashMap(); - private static StatusLogger logger = StatusLogger.getLogger(); + private static final StatusLogger LOGGER = StatusLogger.getLogger(); - public LoggerContext getContext(String FQCN, boolean currentContext) { + public LoggerContext getContext(String fqcn, boolean currentContext) { LoggerContext lc = ContextAnchor.THREAD_CONTEXT.get(); if (lc != null) { @@ -106,7 +106,7 @@ public class JNDIContextSelector impleme Context ctx = new InitialContext(); loggingContextName = (String) lookup(ctx, Constants.JNDI_CONTEXT_NAME); } catch (NamingException ne) { - logger.error("Unable to lookup " + Constants.JNDI_CONTEXT_NAME, ne); + LOGGER.error("Unable to lookup " + Constants.JNDI_CONTEXT_NAME, ne); } return loggingContextName == null ? context : locateContext(loggingContextName, null); @@ -114,7 +114,7 @@ public class JNDIContextSelector impleme public LoggerContext locateContext(String name, String configLocation) { if (name == null) { - logger.error("A context name is required to locate a LoggerContext"); + LOGGER.error("A context name is required to locate a LoggerContext"); return null; } if (!contextMap.containsKey(name)) { @@ -149,8 +149,8 @@ public class JNDIContextSelector impleme } try { return ctx.lookup(name); - } catch(NameNotFoundException e) { - logger.error("Could not find name [" + name + "]."); + } catch (NameNotFoundException e) { + LOGGER.error("Could not find name [" + name + "]."); throw e; } } Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/test/java/org/apache/logging/log4j/core/appender/flume/UUIDTest.java URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/test/java/org/apache/logging/log4j/core/appender/flume/UUIDTest.java?rev=1225762&r1=1225761&r2=1225762&view=diff ============================================================================== --- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/test/java/org/apache/logging/log4j/core/appender/flume/UUIDTest.java (original) +++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/test/java/org/apache/logging/log4j/core/appender/flume/UUIDTest.java Fri Dec 30 06:13:04 2011 @@ -31,11 +31,13 @@ public class UUIDTest { private static final int COUNT = 200; private static final int THREADS = 10; + private static final long NUM_100NS_INTERVALS_SINCE_UUID_EPOCH = 0x01b21dd213814000L; + @Test public void testTimeBaseUUID() { UUID uuid = UUIDUtil.getTimeBasedUUID(); UUID uuid2 = UUIDUtil.getTimeBasedUUID(); - long current = (System.currentTimeMillis() * 10000) + UUIDUtil.NUM_100NS_INTERVALS_SINCE_UUID_EPOCH; + long current = (System.currentTimeMillis() * 10000) + NUM_100NS_INTERVALS_SINCE_UUID_EPOCH; long time = uuid.timestamp(); assertTrue("Incorrect time", current + 10000 - time > 0); UUID[] uuids = new UUID[COUNT];