You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by rg...@apache.org on 2010/05/13 08:31:09 UTC
svn commit: r943816 [7/9] - in
/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers: ./ log4j12-api/
log4j12-api/src/ log4j12-api/src/main/ log4j12-api/src/main/java/
log4j12-api/src/main/java/org/ log4j12-api/src/main/java/org/apache/
log4j12-api/sr...
Added: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/LineLocationPatternConverter.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/layout/pattern/LineLocationPatternConverter.java?rev=943816&view=auto
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/LineLocationPatternConverter.java (added)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/LineLocationPatternConverter.java Thu May 13 06:31:04 2010
@@ -0,0 +1,64 @@
+/*
+ * 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.logging.log4j.core.layout.pattern;
+
+import org.apache.logging.log4j.core.LogEvent;
+import org.apache.logging.log4j.core.config.plugins.Plugin;
+
+
+/**
+ * Return the event's line location information in a StringBuffer.
+ */
+@Plugin(name="LineLocationPatternConverter", type="Converter")
+@ConverterKeys({"L", "line"})
+public final class LineLocationPatternConverter extends LogEventPatternConverter {
+ /**
+ * Singleton.
+ */
+ private static final LineLocationPatternConverter INSTANCE =
+ new LineLocationPatternConverter();
+
+ /**
+ * Private constructor.
+ */
+ private LineLocationPatternConverter() {
+ super("Line", "line");
+ }
+
+ /**
+ * Obtains an instance of pattern converter.
+ *
+ * @param options options, may be null.
+ * @return instance of pattern converter.
+ */
+ public static LineLocationPatternConverter newInstance(
+ final String[] options) {
+ return INSTANCE;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void format(final LogEvent event, final StringBuilder output) {
+ StackTraceElement element = event.getSource();
+
+ if (element != null) {
+ output.append(element.getLineNumber());
+ }
+ }
+}
Added: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/LineSeparatorPatternConverter.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/layout/pattern/LineSeparatorPatternConverter.java?rev=943816&view=auto
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/LineSeparatorPatternConverter.java (added)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/LineSeparatorPatternConverter.java Thu May 13 06:31:04 2010
@@ -0,0 +1,66 @@
+/*
+ * 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.logging.log4j.core.layout.pattern;
+
+import org.apache.logging.log4j.core.Layout;
+import org.apache.logging.log4j.core.LogEvent;
+import org.apache.logging.log4j.core.config.plugins.Plugin;
+
+
+/**
+ * Formats a line separator.
+ */
+@Plugin(name="LineSeparatorPatternConverter", type="Converter")
+@ConverterKeys({"n"})
+public final class LineSeparatorPatternConverter extends LogEventPatternConverter {
+ /**
+ * Singleton.
+ */
+ private static final LineSeparatorPatternConverter INSTANCE =
+ new LineSeparatorPatternConverter();
+
+ /**
+ * Line separator.
+ */
+ private final String lineSep;
+
+ /**
+ * Private constructor.
+ */
+ private LineSeparatorPatternConverter() {
+ super("Line Sep", "lineSep");
+ lineSep = Layout.LINE_SEP;
+ }
+
+ /**
+ * Obtains an instance of pattern converter.
+ * @param options options, may be null.
+ * @return instance of pattern converter.
+ */
+ public static LineSeparatorPatternConverter newInstance(
+ final String[] options) {
+ return INSTANCE;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void format(LogEvent event, final StringBuilder toAppendTo) {
+ toAppendTo.append(lineSep);
+ }
+}
Added: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/LiteralPatternConverter.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/layout/pattern/LiteralPatternConverter.java?rev=943816&view=auto
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/LiteralPatternConverter.java (added)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/LiteralPatternConverter.java Thu May 13 06:31:04 2010
@@ -0,0 +1,47 @@
+/*
+ * 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.logging.log4j.core.layout.pattern;
+
+import org.apache.logging.log4j.core.LogEvent;
+
+
+/**
+ * Formats a string literal.
+ */
+public final class LiteralPatternConverter extends LogEventPatternConverter {
+ /**
+ * String literal.
+ */
+ private final String literal;
+
+ /**
+ * Create a new instance.
+ * @param literal string literal.
+ */
+ public LiteralPatternConverter(final String literal) {
+ super("Literal", "literal");
+ this.literal = literal;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void format(final LogEvent event, final StringBuilder toAppendTo) {
+ toAppendTo.append(literal);
+ }
+}
Added: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/LogEventPatternConverter.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/layout/pattern/LogEventPatternConverter.java?rev=943816&view=auto
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/LogEventPatternConverter.java (added)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/LogEventPatternConverter.java Thu May 13 06:31:04 2010
@@ -0,0 +1,71 @@
+/*
+ * 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.logging.log4j.core.layout.pattern;
+
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.core.LogEvent;
+import org.apache.logging.log4j.internal.StatusLogger;
+
+/**
+ * LoggingEventPatternConverter is a base class for pattern converters
+ * that can format information from instances of LoggingEvent.
+ */
+public abstract class LogEventPatternConverter extends PatternConverter {
+
+ protected static final Logger logger = StatusLogger.getLogger();
+ /**
+ * Constructs an instance of LoggingEventPatternConverter.
+ *
+ * @param name name of converter.
+ * @param style CSS style for output.
+ */
+ protected LogEventPatternConverter(
+ final String name, final String style) {
+ super(name, style);
+ }
+
+ /**
+ * Formats an event into a string buffer.
+ *
+ * @param event event to format, may not be null.
+ * @param toAppendTo string buffer to which the formatted event will be appended. May not be null.
+ */
+ public abstract void format(final LogEvent event, final StringBuilder toAppendTo);
+
+ /**
+ * {@inheritDoc}
+ */
+ public void format(final Object obj, final StringBuilder output) {
+ if (obj instanceof LogEvent) {
+ format((LogEvent) obj, output);
+ }
+ }
+
+ /**
+ * Normally pattern converters are not meant to handle Exceptions although
+ * few pattern converters might.
+ * <p/>
+ * By examining the return values for this method, the containing layout will
+ * determine whether it handles throwables or not.
+ *
+ * @return true if this PatternConverter handles throwables
+ */
+ public boolean handlesThrowable() {
+ return false;
+ }
+}
Added: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/LoggerPatternConverter.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/layout/pattern/LoggerPatternConverter.java?rev=943816&view=auto
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/LoggerPatternConverter.java (added)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/LoggerPatternConverter.java Thu May 13 06:31:04 2010
@@ -0,0 +1,68 @@
+/*
+ * 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.logging.log4j.core.layout.pattern;
+
+import org.apache.logging.log4j.core.LogEvent;
+import org.apache.logging.log4j.core.config.plugins.Plugin;
+
+
+/**
+ * Formats a logger name.
+ */
+@Plugin(name="LoggerPatternConverter", type="Converter")
+@ConverterKeys({"c", "logger"})
+public final class LoggerPatternConverter extends NamePatternConverter {
+ /**
+ * Singleton.
+ */
+ private static final LoggerPatternConverter INSTANCE =
+ new LoggerPatternConverter(null);
+
+ /**
+ * Private constructor.
+ *
+ * @param options options, may be null.
+ */
+ private LoggerPatternConverter(final String[] options) {
+ super("Logger", "logger", options);
+ }
+
+ /**
+ * Obtains an instance of pattern converter.
+ *
+ * @param options options, may be null.
+ * @return instance of pattern converter.
+ */
+ public static LoggerPatternConverter newInstance(
+ final String[] options) {
+ if ((options == null) || (options.length == 0)) {
+ return INSTANCE;
+ }
+
+ return new LoggerPatternConverter(options);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void format(final LogEvent event, final StringBuilder toAppendTo) {
+ final int initialLength = toAppendTo.length();
+ toAppendTo.append(event.getLoggerName());
+ abbreviate(initialLength, toAppendTo);
+ }
+}
Added: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/MDCPatternConverter.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/layout/pattern/MDCPatternConverter.java?rev=943816&view=auto
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/MDCPatternConverter.java (added)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/MDCPatternConverter.java Thu May 13 06:31:04 2010
@@ -0,0 +1,99 @@
+/*
+ * 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.logging.log4j.core.layout.pattern;
+
+import org.apache.logging.log4j.core.LogEvent;
+import org.apache.logging.log4j.core.config.plugins.Plugin;
+
+import java.util.Map;
+import java.util.Set;
+import java.util.SortedSet;
+import java.util.TreeMap;
+import java.util.TreeSet;
+
+/**
+ * Able to handle the contents of the LogEvent's MDC and either
+ * output the entire contents of the properties in a similar format to the
+ * java.util.Hashtable.toString(), or to output the value of a specific key
+ * within the property bundle
+ * when this pattern converter has the option set.
+ */
+ @Plugin(name="MDCPatternConverter", type="Converter")
+@ConverterKeys({"X", "mdc", "MDC"})
+public final class MDCPatternConverter extends LogEventPatternConverter {
+ /**
+ * Name of property to output.
+ */
+ private final String key;
+
+ /**
+ * Private constructor.
+ *
+ * @param options options, may be null.
+ */
+ private MDCPatternConverter(final String[] options) {
+ super(((options != null) && (options.length > 0)) ? ("MDC{" + options[0] + "}") : "MDC", "mdc");
+ key = (options != null && options.length > 0) ? options[0] : null;
+ }
+
+ /**
+ * Obtains an instance of PropertiesPatternConverter.
+ *
+ * @param options options, may be null or first element contains name of property to format.
+ * @return instance of PropertiesPatternConverter.
+ */
+ public static MDCPatternConverter newInstance(
+ final String[] options) {
+ return new MDCPatternConverter(options);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void format(final LogEvent event, final StringBuilder toAppendTo) {
+ Map<String, Object> contextMap = event.getContextMap();
+ // if there is no additional options, we output every single
+ // Key/Value pair for the MDC in a similar format to Hashtable.toString()
+ if (key == null) {
+
+
+ if (contextMap == null || contextMap.size() == 0) {
+ toAppendTo.append("{}");
+ return;
+ }
+ StringBuilder sb = new StringBuilder("{");
+ Set<String> keys = new TreeSet<String>(contextMap.keySet());
+ for (String key : keys) {
+ if (sb.length() > 1) {
+ sb.append(", ");
+ }
+ sb.append(key).append("=").append(contextMap.get(key));
+
+ }
+ sb.append("}");
+ toAppendTo.append(sb);
+ } else if (contextMap != null) {
+ // otherwise they just want a single key output
+ Object val = contextMap.get(key);
+
+ if (val != null) {
+ toAppendTo.append(val);
+ }
+ }
+ }
+}
Added: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/MessagePatternConverter.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/layout/pattern/MessagePatternConverter.java?rev=943816&view=auto
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/MessagePatternConverter.java (added)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/MessagePatternConverter.java Thu May 13 06:31:04 2010
@@ -0,0 +1,60 @@
+/*
+ * 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.logging.log4j.core.layout.pattern;
+
+import org.apache.logging.log4j.core.LogEvent;
+import org.apache.logging.log4j.core.config.plugins.Plugin;
+
+
+/**
+ * Return the event's rendered message in a StringBuffer.
+ */
+@Plugin(name="MessagePatternConverter", type="Converter")
+@ConverterKeys({"m", "message"})
+public final class MessagePatternConverter extends LogEventPatternConverter {
+ /**
+ * Singleton.
+ */
+ private static final MessagePatternConverter INSTANCE =
+ new MessagePatternConverter();
+
+ /**
+ * Private constructor.
+ */
+ private MessagePatternConverter() {
+ super("Message", "message");
+ }
+
+ /**
+ * Obtains an instance of pattern converter.
+ *
+ * @param options options, may be null.
+ * @return instance of pattern converter.
+ */
+ public static MessagePatternConverter newInstance(
+ final String[] options) {
+ return INSTANCE;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void format(final LogEvent event, final StringBuilder toAppendTo) {
+ toAppendTo.append(event.getMessage().getFormattedMessage());
+ }
+}
Added: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/MethodLocationPatternConverter.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/layout/pattern/MethodLocationPatternConverter.java?rev=943816&view=auto
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/MethodLocationPatternConverter.java (added)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/MethodLocationPatternConverter.java Thu May 13 06:31:04 2010
@@ -0,0 +1,64 @@
+/*
+ * 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.logging.log4j.core.layout.pattern;
+
+import org.apache.logging.log4j.core.LogEvent;
+import org.apache.logging.log4j.core.config.plugins.Plugin;
+
+
+/**
+ * Return the event's line location information in a StringBuffer.
+ */
+@Plugin(name = "MethodLocationPatternConverter", type = "Converter")
+@ConverterKeys({"M", "method"})
+public final class MethodLocationPatternConverter extends LogEventPatternConverter {
+ /**
+ * Singleton.
+ */
+ private static final MethodLocationPatternConverter INSTANCE =
+ new MethodLocationPatternConverter();
+
+ /**
+ * Private constructor.
+ */
+ private MethodLocationPatternConverter() {
+ super("Method", "method");
+ }
+
+ /**
+ * Obtains an instance of MethodLocationPatternConverter.
+ *
+ * @param options options, may be null.
+ * @return instance of MethodLocationPatternConverter.
+ */
+ public static MethodLocationPatternConverter newInstance(
+ final String[] options) {
+ return INSTANCE;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void format(final LogEvent event, final StringBuilder toAppendTo) {
+ StackTraceElement element = event.getSource();
+
+ if (element != null) {
+ toAppendTo.append(element.getMethodName());
+ }
+ }
+}
Added: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/NDCPatternConverter.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/layout/pattern/NDCPatternConverter.java?rev=943816&view=auto
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/NDCPatternConverter.java (added)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/NDCPatternConverter.java Thu May 13 06:31:04 2010
@@ -0,0 +1,59 @@
+/*
+ * 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.logging.log4j.core.layout.pattern;
+
+import org.apache.logging.log4j.core.LogEvent;
+import org.apache.logging.log4j.core.config.plugins.Plugin;
+
+
+/**
+ * Return the event's NDC in a StringBuffer.
+ */
+@Plugin(name="NDCPatternConverter", type="Converter")
+@ConverterKeys({"C", "class"})
+public final class NDCPatternConverter extends LogEventPatternConverter {
+ /**
+ * Singleton.
+ */
+ private static final NDCPatternConverter INSTANCE =
+ new NDCPatternConverter();
+
+ /**
+ * Private constructor.
+ */
+ private NDCPatternConverter() {
+ super("NDC", "ndc");
+ }
+
+ /**
+ * Obtains an instance of NDCPatternConverter.
+ * @param options options, may be null.
+ * @return instance of NDCPatternConverter.
+ */
+ public static NDCPatternConverter newInstance(
+ final String[] options) {
+ return INSTANCE;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void format(final LogEvent event, final StringBuilder toAppendTo) {
+ toAppendTo.append(event.getContextStack());
+ }
+}
Added: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/NameAbbreviator.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/layout/pattern/NameAbbreviator.java?rev=943816&view=auto
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/NameAbbreviator.java (added)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/NameAbbreviator.java Thu May 13 06:31:04 2010
@@ -0,0 +1,303 @@
+/*
+ * 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.logging.log4j.core.layout.pattern;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * NameAbbreviator generates abbreviated logger and class names.
+ */
+public abstract class NameAbbreviator {
+ /**
+ * Default (no abbreviation) abbreviator.
+ */
+ private static final NameAbbreviator DEFAULT = new NOPAbbreviator();
+
+ /**
+ * Gets an abbreviator.
+ * <p/>
+ * For example, "%logger{2}" will output only 2 elements of the logger name,
+ * "%logger{1.}" will output only the first character of the non-final elements in the name,
+ * "%logger(1~.2~} will output the first character of the first element, two characters of
+ * the second and subsequent elements and will use a tilde to indicate abbreviated characters.
+ *
+ * @param pattern abbreviation pattern.
+ * @return abbreviator, will not be null.
+ */
+ public static NameAbbreviator getAbbreviator(final String pattern) {
+ if (pattern.length() > 0) {
+ // if pattern is just spaces and numbers then
+ // use MaxElementAbbreviator
+ String trimmed = pattern.trim();
+
+ if (trimmed.length() == 0) {
+ return DEFAULT;
+ }
+
+ int i = 0;
+
+ while ((i < trimmed.length()) && (trimmed.charAt(i) >= '0')
+ && (trimmed.charAt(i) <= '9')) {
+ i++;
+ }
+
+ //
+ // if all blanks and digits
+ //
+ if (i == trimmed.length()) {
+ return new MaxElementAbbreviator(Integer.parseInt(trimmed));
+ }
+
+ ArrayList<PatternAbbreviatorFragment> fragments = new ArrayList<PatternAbbreviatorFragment>(5);
+ char ellipsis;
+ int charCount;
+ int pos = 0;
+
+ while ((pos < trimmed.length()) && (pos >= 0)) {
+ int ellipsisPos = pos;
+
+ if (trimmed.charAt(pos) == '*') {
+ charCount = Integer.MAX_VALUE;
+ ellipsisPos++;
+ } else {
+ if ((trimmed.charAt(pos) >= '0') && (trimmed.charAt(pos) <= '9')) {
+ charCount = trimmed.charAt(pos) - '0';
+ ellipsisPos++;
+ } else {
+ charCount = 0;
+ }
+ }
+
+ ellipsis = '\0';
+
+ if (ellipsisPos < trimmed.length()) {
+ ellipsis = trimmed.charAt(ellipsisPos);
+
+ if (ellipsis == '.') {
+ ellipsis = '\0';
+ }
+ }
+
+ fragments.add(new PatternAbbreviatorFragment(charCount, ellipsis));
+ pos = trimmed.indexOf(".", pos);
+
+ if (pos == -1) {
+ break;
+ }
+
+ pos++;
+ }
+
+ return new PatternAbbreviator(fragments);
+ }
+
+ //
+ // no matching abbreviation, return defaultAbbreviator
+ //
+ return DEFAULT;
+ }
+
+ /**
+ * Gets default abbreviator.
+ *
+ * @return default abbreviator.
+ */
+ public static NameAbbreviator getDefaultAbbreviator() {
+ return DEFAULT;
+ }
+
+ /**
+ * Abbreviates a name in a StringBuffer.
+ *
+ * @param nameStart starting position of name in buf.
+ * @param buf buffer, may not be null.
+ */
+ public abstract void abbreviate(final int nameStart, final StringBuilder buf);
+
+ /**
+ * Abbreviator that simply appends full name to buffer.
+ */
+ private static class NOPAbbreviator extends NameAbbreviator {
+ /**
+ * Constructor.
+ */
+ public NOPAbbreviator() {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void abbreviate(final int nameStart, final StringBuilder buf) {
+ }
+ }
+
+ /**
+ * Abbreviator that drops starting path elements.
+ */
+ private static class MaxElementAbbreviator extends NameAbbreviator {
+ /**
+ * Maximum number of path elements to output.
+ */
+ private final int count;
+
+ /**
+ * Create new instance.
+ *
+ * @param count maximum number of path elements to output.
+ */
+ public MaxElementAbbreviator(final int count) {
+ this.count = count;
+ }
+
+ /**
+ * Abbreviate name.
+ *
+ * @param buf buffer to append abbreviation.
+ * @param nameStart start of name to abbreviate.
+ */
+ public void abbreviate(final int nameStart, final StringBuilder buf) {
+ int len = buf.length() - nameStart;
+
+ // We substract 1 from 'len' when assigning to 'end' to avoid out of
+ // bounds exception in return r.substring(end+1, len). This can happen if
+ // precision is 1 and the category name ends with a dot.
+ int end = buf.length() - 1;
+
+ String bufString = buf.toString();
+ for (int i = count; i > 0; i--) {
+ end = bufString.lastIndexOf(".", end - 1);
+
+ if ((end == -1) || (end < nameStart)) {
+ return;
+ }
+ }
+
+ buf.delete(nameStart, end + 1);
+ }
+ }
+
+ /**
+ * Fragment of an pattern abbreviator.
+ */
+ private static class PatternAbbreviatorFragment {
+ /**
+ * Count of initial characters of element to output.
+ */
+ private final int charCount;
+
+ /**
+ * Character used to represent dropped characters.
+ * '\0' indicates no representation of dropped characters.
+ */
+ private final char ellipsis;
+
+ /**
+ * Creates a PatternAbbreviatorFragment.
+ *
+ * @param charCount number of initial characters to preserve.
+ * @param ellipsis character to represent elimination of characters,
+ * '\0' if no ellipsis is desired.
+ */
+ public PatternAbbreviatorFragment(
+ final int charCount, final char ellipsis) {
+ this.charCount = charCount;
+ this.ellipsis = ellipsis;
+ }
+
+ /**
+ * Abbreviate element of name.
+ *
+ * @param buf buffer to receive element.
+ * @param startPos starting index of name element.
+ * @return starting index of next element.
+ */
+ public int abbreviate(final StringBuilder buf, final int startPos) {
+ int nextDot = buf.toString().indexOf(".", startPos);
+
+ if (nextDot != -1) {
+ if ((nextDot - startPos) > charCount) {
+ buf.delete(startPos + charCount, nextDot);
+ nextDot = startPos + charCount;
+
+ if (ellipsis != '\0') {
+ buf.insert(nextDot, ellipsis);
+ nextDot++;
+ }
+ }
+
+ nextDot++;
+ }
+
+ return nextDot;
+ }
+ }
+
+ /**
+ * Pattern abbreviator.
+ */
+ private static class PatternAbbreviator extends NameAbbreviator {
+ /**
+ * Element abbreviation patterns.
+ */
+ private final PatternAbbreviatorFragment[] fragments;
+
+ /**
+ * Create PatternAbbreviator.
+ *
+ * @param fragments element abbreviation patterns.
+ */
+ public PatternAbbreviator(List fragments) {
+ if (fragments.size() == 0) {
+ throw new IllegalArgumentException(
+ "fragments must have at least one element");
+ }
+
+ this.fragments = new PatternAbbreviatorFragment[fragments.size()];
+ fragments.toArray(this.fragments);
+ }
+
+ /**
+ * Abbreviate name.
+ *
+ * @param buf buffer that abbreviated name is appended.
+ * @param nameStart start of name.
+ */
+ public void abbreviate(final int nameStart, final StringBuilder buf) {
+ //
+ // all non-terminal patterns are executed once
+ //
+ int pos = nameStart;
+
+ for (int i = 0; (i < (fragments.length - 1)) && (pos < buf.length());
+ i++) {
+ pos = fragments[i].abbreviate(buf, pos);
+ }
+
+ //
+ // last pattern in executed repeatedly
+ //
+ PatternAbbreviatorFragment terminalFragment = fragments[fragments.length - 1];
+
+ while ((pos < buf.length()) && (pos >= 0)) {
+ pos = terminalFragment.abbreviate(buf, pos);
+ }
+ }
+ }
+}
Added: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/NamePatternConverter.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/layout/pattern/NamePatternConverter.java?rev=943816&view=auto
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/NamePatternConverter.java (added)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/NamePatternConverter.java Thu May 13 06:31:04 2010
@@ -0,0 +1,56 @@
+/*
+ * 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.logging.log4j.core.layout.pattern;
+
+
+/**
+ * Base class for other pattern converters which can return only parts of their name.
+ */
+public abstract class NamePatternConverter extends LogEventPatternConverter {
+ /**
+ * Abbreviator.
+ */
+ private final NameAbbreviator abbreviator;
+
+ /**
+ * Constructor.
+ *
+ * @param name name of converter.
+ * @param style style name for associated output.
+ * @param options options, may be null, first element will be interpreted as an abbreviation pattern.
+ */
+ protected NamePatternConverter(final String name, final String style, final String[] options) {
+ super(name, style);
+
+ if ((options != null) && (options.length > 0)) {
+ abbreviator = NameAbbreviator.getAbbreviator(options[0]);
+ } else {
+ abbreviator = NameAbbreviator.getDefaultAbbreviator();
+ }
+ }
+
+ /**
+ * Abbreviate name in string buffer.
+ *
+ * @param nameStart starting position of name to abbreviate.
+ * @param buf string buffer containing name.
+ */
+ protected final void abbreviate(final int nameStart, final StringBuilder buf) {
+ abbreviator.abbreviate(nameStart, buf);
+ }
+}
Added: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/PatternConverter.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/layout/pattern/PatternConverter.java?rev=943816&view=auto
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/PatternConverter.java (added)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/PatternConverter.java Thu May 13 06:31:04 2010
@@ -0,0 +1,82 @@
+/*
+ * 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.logging.log4j.core.layout.pattern;
+
+
+/**
+ * <p>PatternConverter is an abstract class that provides the
+ * formatting functionality that derived classes need.
+ * <p/>
+ * <p>Conversion specifiers in a conversion patterns are parsed to
+ * individual PatternConverters. Each of which is responsible for
+ * converting an object in a converter specific manner.
+ */
+public abstract class PatternConverter {
+ /**
+ * Converter name.
+ */
+ private final String name;
+
+ /**
+ * Converter style name.
+ */
+ private final String style;
+
+ /**
+ * Create a new pattern converter.
+ *
+ * @param name name for pattern converter.
+ * @param style CSS style for formatted output.
+ */
+ protected PatternConverter(final String name, final String style) {
+ this.name = name;
+ this.style = style;
+ }
+
+ /**
+ * Formats an object into a string buffer.
+ *
+ * @param obj event to format, may not be null.
+ * @param toAppendTo string buffer to which the formatted event will be appended. May not be null.
+ */
+ public abstract void format(final Object obj, final StringBuilder toAppendTo);
+
+ /**
+ * This method returns the name of the conversion pattern.
+ * <p/>
+ * The name can be useful to certain Layouts such as HTMLLayout.
+ *
+ * @return the name of the conversion pattern
+ */
+ public final String getName() {
+ return name;
+ }
+
+ /**
+ * This method returns the CSS style class that should be applied to
+ * the LoggingEvent passed as parameter, which can be null.
+ * <p/>
+ * This information is currently used only by HTMLLayout.
+ *
+ * @param e null values are accepted
+ * @return the name of the conversion pattern
+ */
+ public String getStyleClass(Object e) {
+ return style;
+ }
+}
Added: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/PatternParser.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/layout/pattern/PatternParser.java?rev=943816&view=auto
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/PatternParser.java (added)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/PatternParser.java Thu May 13 06:31:04 2010
@@ -0,0 +1,493 @@
+/*
+ * 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.logging.log4j.core.layout.pattern;
+
+import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.core.config.plugins.PluginManager;
+import org.apache.logging.log4j.core.config.plugins.PluginType;
+import org.apache.logging.log4j.internal.StatusLogger;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Most of the work of the {@link org.apache.logging.log4j.core.layout.PatternLayout} class
+ * is delegated to the PatternParser class.
+ * <p>It is this class that parses conversion patterns and creates
+ * a chained list of {@link PatternConverter PatternConverters}.
+ */
+public final class PatternParser {
+ /**
+ * Escape character for format specifier.
+ */
+ private static final char ESCAPE_CHAR = '%';
+
+ /**
+ * Literal state.
+ */
+ private static final int LITERAL_STATE = 0;
+
+ /**
+ * In converter name state.
+ */
+ private static final int CONVERTER_STATE = 1;
+
+ /**
+ * Dot state.
+ */
+ private static final int DOT_STATE = 3;
+
+ /**
+ * Min state.
+ */
+ private static final int MIN_STATE = 4;
+
+ /**
+ * Max state.
+ */
+ private static final int MAX_STATE = 5;
+
+ /**
+ * Does pattern process exceptions.
+ */
+ private boolean handlesExceptions;
+
+ private final Map<String, Class<PatternConverter>> converterRules;
+
+ protected final static Logger logger = StatusLogger.getLogger();
+
+
+ /**
+ * Constructor
+ * @param converterKey The key to lookup the converters.
+ */
+ public PatternParser(String converterKey) {
+ PluginManager manager = new PluginManager(converterKey);
+ manager.collectPlugins();
+ Map<String, PluginType> plugins = manager.getPlugins();
+ Map<String, Class<PatternConverter>> converters = new HashMap<String, Class<PatternConverter>>();
+
+ for (PluginType type : plugins.values()) {
+ try {
+ Class<PatternConverter> clazz = type.getPluginClass();
+ ConverterKeys keys = clazz.getAnnotation(ConverterKeys.class);
+ if (keys != null) {
+ for (String key : keys.value()) {
+ converters.put(key, clazz);
+ }
+ }
+ } catch (Exception ex) {
+
+ }
+ }
+ converterRules = converters;
+ }
+
+
+ public List<PatternConverter> parse(String pattern) {
+ List<PatternConverter> converters = new ArrayList<PatternConverter>();
+ List<FormattingInfo> fields = new ArrayList<FormattingInfo>();
+
+ parse(pattern, converters, fields, converterRules);
+
+ LogEventPatternConverter[] patternConverters = new LogEventPatternConverter[converters.size()];
+ FormattingInfo[] patternFields = new FormattingInfo[converters.size()];
+
+ int i = 0;
+ Iterator fieldIter = fields.iterator();
+
+ for (PatternConverter converter : converters) {
+ if (converter instanceof LogEventPatternConverter) {
+ patternConverters[i] = (LogEventPatternConverter) converter;
+ handlesExceptions |= patternConverters[i].handlesThrowable();
+ } else {
+ patternConverters[i] = new LiteralPatternConverter("");
+ }
+
+ if (fieldIter.hasNext()) {
+ patternFields[i] = (FormattingInfo) fieldIter.next();
+ } else {
+ patternFields[i] = FormattingInfo.getDefault();
+ }
+
+ i++;
+ }
+ return converters;
+ }
+
+ public boolean handlesExceptions() {
+ return handlesExceptions;
+ }
+
+ /**
+ * Extract the converter identifier found at position i.
+ * <p/>
+ * After this function returns, the variable i will point to the
+ * first char after the end of the converter identifier.
+ * <p/>
+ * If i points to a char which is not a character acceptable at the
+ * start of a unicode identifier, the value null is returned.
+ *
+ * @param lastChar last processed character.
+ * @param pattern format string.
+ * @param i current index into pattern format.
+ * @param convBuf buffer to receive conversion specifier.
+ * @param currentLiteral literal to be output in case format specifier in unrecognized.
+ * @return position in pattern after converter.
+ */
+ private static int extractConverter(
+ char lastChar, final String pattern, int i, final StringBuilder convBuf,
+ final StringBuilder currentLiteral) {
+ convBuf.setLength(0);
+
+ // When this method is called, lastChar points to the first character of the
+ // conversion word. For example:
+ // For "%hello" lastChar = 'h'
+ // For "%-5hello" lastChar = 'h'
+ //System.out.println("lastchar is "+lastChar);
+ if (!Character.isUnicodeIdentifierStart(lastChar)) {
+ return i;
+ }
+
+ convBuf.append(lastChar);
+
+ while ((i < pattern.length()) && Character.isUnicodeIdentifierPart(pattern.charAt(i))) {
+ convBuf.append(pattern.charAt(i));
+ currentLiteral.append(pattern.charAt(i));
+ i++;
+ }
+
+ return i;
+ }
+
+ /**
+ * Extract options.
+ *
+ * @param pattern conversion pattern.
+ * @param i start of options.
+ * @param options array to receive extracted options
+ * @return position in pattern after options.
+ */
+ private static int extractOptions(String pattern, int i, List<String> options) {
+ while ((i < pattern.length()) && (pattern.charAt(i) == '{')) {
+ int end = pattern.indexOf('}', i);
+
+ if (end == -1) {
+ break;
+ }
+
+ String r = pattern.substring(i + 1, end);
+ options.add(r);
+ i = end + 1;
+ }
+
+ return i;
+ }
+
+ /**
+ * Parse a format specifier.
+ *
+ * @param pattern pattern to parse.
+ * @param patternConverters list to receive pattern converters.
+ * @param formattingInfos list to receive field specifiers corresponding to pattern converters.
+ * @param rules map of stock pattern converters keyed by format specifier.
+ */
+ public void parse(final String pattern, final List<PatternConverter> patternConverters,
+ final List<FormattingInfo> formattingInfos,
+ final Map<String, Class<PatternConverter>> rules) {
+ if (pattern == null) {
+ throw new NullPointerException("pattern");
+ }
+
+ StringBuilder currentLiteral = new StringBuilder(32);
+
+ int patternLength = pattern.length();
+ int state = LITERAL_STATE;
+ char c;
+ int i = 0;
+ FormattingInfo formattingInfo = FormattingInfo.getDefault();
+
+ while (i < patternLength) {
+ c = pattern.charAt(i++);
+
+ switch (state) {
+ case LITERAL_STATE:
+
+ // In literal state, the last char is always a literal.
+ if (i == patternLength) {
+ currentLiteral.append(c);
+
+ continue;
+ }
+
+ if (c == ESCAPE_CHAR) {
+ // peek at the next char.
+ switch (pattern.charAt(i)) {
+ case ESCAPE_CHAR:
+ currentLiteral.append(c);
+ i++; // move pointer
+
+ break;
+
+ default:
+
+ if (currentLiteral.length() != 0) {
+ patternConverters.add(new LiteralPatternConverter(currentLiteral.toString()));
+ formattingInfos.add(FormattingInfo.getDefault());
+ }
+
+ currentLiteral.setLength(0);
+ currentLiteral.append(c); // append %
+ state = CONVERTER_STATE;
+ formattingInfo = FormattingInfo.getDefault();
+ }
+ } else {
+ currentLiteral.append(c);
+ }
+
+ break;
+
+ case CONVERTER_STATE:
+ currentLiteral.append(c);
+
+ switch (c) {
+ case '-':
+ formattingInfo =
+ new FormattingInfo(true, formattingInfo.getMinLength(),
+ formattingInfo.getMaxLength());
+
+ break;
+
+ case '.':
+ state = DOT_STATE;
+
+ break;
+
+ default:
+
+ if ((c >= '0') && (c <= '9')) {
+ formattingInfo = new FormattingInfo(formattingInfo.isLeftAligned(), c - '0',
+ formattingInfo.getMaxLength());
+ state = MIN_STATE;
+ } else {
+ i = finalizeConverter(c, pattern, i, currentLiteral, formattingInfo,
+ rules, patternConverters, formattingInfos);
+
+ // Next pattern is assumed to be a literal.
+ state = LITERAL_STATE;
+ formattingInfo = FormattingInfo.getDefault();
+ currentLiteral.setLength(0);
+ }
+ } // switch
+
+ break;
+
+ case MIN_STATE:
+ currentLiteral.append(c);
+
+ if ((c >= '0') && (c <= '9')) {
+ formattingInfo = new FormattingInfo(formattingInfo.isLeftAligned(),
+ (formattingInfo.getMinLength() * 10) + (c - '0'),
+ formattingInfo.getMaxLength());
+ } else if (c == '.') {
+ state = DOT_STATE;
+ } else {
+ i = finalizeConverter(c, pattern, i, currentLiteral, formattingInfo,
+ rules, patternConverters, formattingInfos);
+ state = LITERAL_STATE;
+ formattingInfo = FormattingInfo.getDefault();
+ currentLiteral.setLength(0);
+ }
+
+ break;
+
+ case DOT_STATE:
+ currentLiteral.append(c);
+
+ if ((c >= '0') && (c <= '9')) {
+ formattingInfo = new FormattingInfo(formattingInfo.isLeftAligned(),
+ formattingInfo.getMinLength(), c - '0');
+ state = MAX_STATE;
+ } else {
+ logger.error("Error occurred in position " + i
+ + ".\n Was expecting digit, instead got char \"" + c + "\".");
+
+ state = LITERAL_STATE;
+ }
+
+ break;
+
+ case MAX_STATE:
+ currentLiteral.append(c);
+
+ if ((c >= '0') && (c <= '9')) {
+ formattingInfo = new FormattingInfo(
+ formattingInfo.isLeftAligned(), formattingInfo.getMinLength(),
+ (formattingInfo.getMaxLength() * 10) + (c - '0'));
+ } else {
+ i = finalizeConverter(c, pattern, i, currentLiteral, formattingInfo,
+ rules, patternConverters, formattingInfos);
+ state = LITERAL_STATE;
+ formattingInfo = FormattingInfo.getDefault();
+ currentLiteral.setLength(0);
+ }
+
+ break;
+ } // switch
+ }
+
+ // while
+ if (currentLiteral.length() != 0) {
+ patternConverters.add(new LiteralPatternConverter(currentLiteral.toString()));
+ formattingInfos.add(FormattingInfo.getDefault());
+ }
+ }
+
+ /**
+ * Creates a new PatternConverter.
+ *
+ * @param converterId converterId.
+ * @param currentLiteral literal to be used if converter is unrecognized or following converter
+ * if converterId contains extra characters.
+ * @param rules map of stock pattern converters keyed by format specifier.
+ * @param options converter options.
+ * @return converter or null.
+ */
+ private PatternConverter createConverter(final String converterId, final StringBuilder currentLiteral,
+ final Map<String, Class<PatternConverter>> rules,
+ final List<String> options) {
+ String converterName = converterId;
+ Class<PatternConverter> converterClass = null;
+
+ for (int i = converterId.length(); (i > 0) && (converterClass == null); i--) {
+ converterName = converterName.substring(0, i);
+
+ if ((converterClass == null) && (rules != null)) {
+ converterClass = rules.get(converterName);
+ }
+ }
+
+ if (converterClass == null) {
+ logger.error("Unrecognized format specifier [" + converterId + "]");
+
+ return null;
+ }
+
+ try {
+ Method factory = converterClass.getMethod(
+ "newInstance",
+ new Class[]{
+ Class.forName("[Ljava.lang.String;")
+ });
+ String[] optionsArray = new String[options.size()];
+ optionsArray = options.toArray(optionsArray);
+
+ Object newObj = factory.invoke(null, new Object[]{optionsArray});
+
+ if (newObj instanceof PatternConverter) {
+ currentLiteral.delete(0, currentLiteral.length()
+ - (converterId.length() - converterName.length()));
+
+ return (PatternConverter) newObj;
+ } else {
+ logger.warn("Class " + converterClass.getName() + " does not extend PatternConverter.");
+ }
+ } catch (Exception ex) {
+ logger.error("Error creating converter for " + converterId, ex);
+
+ try {
+ //
+ // try default constructor
+ PatternConverter pc = converterClass.newInstance();
+ currentLiteral.delete(0, currentLiteral.length()
+ - (converterId.length() - converterName.length()));
+
+ return pc;
+ } catch (Exception ex2) {
+ logger.error("Error creating converter for " + converterId, ex2);
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * Processes a format specifier sequence.
+ *
+ * @param c initial character of format specifier.
+ * @param pattern conversion pattern
+ * @param i current position in conversion pattern.
+ * @param currentLiteral current literal.
+ * @param formattingInfo current field specifier.
+ * @param rules map of stock pattern converters keyed by format specifier.
+ * @param patternConverters list to receive parsed pattern converter.
+ * @param formattingInfos list to receive corresponding field specifier.
+ * @return position after format specifier sequence.
+ */
+ private int finalizeConverter(char c, String pattern, int i,
+ final StringBuilder currentLiteral, final FormattingInfo formattingInfo,
+ final Map<String, Class<PatternConverter>> rules,
+ final List<PatternConverter> patternConverters, final List<FormattingInfo> formattingInfos) {
+ StringBuilder convBuf = new StringBuilder();
+ i = extractConverter(c, pattern, i, convBuf, currentLiteral);
+
+ String converterId = convBuf.toString();
+
+ List<String> options = new ArrayList<String>();
+ i = extractOptions(pattern, i, options);
+
+ PatternConverter pc = createConverter(converterId, currentLiteral, rules, options);
+
+ if (pc == null) {
+ StringBuilder msg;
+
+ if ((converterId == null) || (converterId.length() == 0)) {
+ msg =
+ new StringBuilder("Empty conversion specifier starting at position ");
+ } else {
+ msg = new StringBuilder("Unrecognized conversion specifier [");
+ msg.append(converterId);
+ msg.append("] starting at position ");
+ }
+
+ msg.append(Integer.toString(i));
+ msg.append(" in conversion pattern.");
+
+ logger.error(msg.toString());
+
+ patternConverters.add(new LiteralPatternConverter(currentLiteral.toString()));
+ formattingInfos.add(FormattingInfo.getDefault());
+ } else {
+ patternConverters.add(pc);
+ formattingInfos.add(formattingInfo);
+
+ if (currentLiteral.length() > 0) {
+ patternConverters.add(new LiteralPatternConverter(currentLiteral.toString()));
+ formattingInfos.add(FormattingInfo.getDefault());
+ }
+ }
+
+ currentLiteral.setLength(0);
+
+ return i;
+ }
+}
Added: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/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/layout/pattern/RelativeTimePatternConverter.java?rev=943816&view=auto
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/RelativeTimePatternConverter.java (added)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/RelativeTimePatternConverter.java Thu May 13 06:31:04 2010
@@ -0,0 +1,70 @@
+/*
+ * 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.logging.log4j.core.layout.pattern;
+
+import org.apache.logging.log4j.core.LogEvent;
+import org.apache.logging.log4j.core.config.plugins.Plugin;
+
+
+/**
+ * Return the relative time in milliseconds since loading of the LoggingEvent
+ * class.
+ */
+@Plugin(name="RelativeTimePatternConverter", type="Converter")
+@ConverterKeys({"r", "relative"})
+public class RelativeTimePatternConverter extends LogEventPatternConverter {
+ /**
+ * Cached formatted timestamp.
+ */
+ private long lastTimestamp = Long.MIN_VALUE;
+ private long startTime = System.currentTimeMillis();
+ private String relative;
+
+ /**
+ * Private constructor.
+ */
+ public RelativeTimePatternConverter() {
+ super("Time", "time");
+ }
+
+ /**
+ * Obtains an instance of RelativeTimePatternConverter.
+ *
+ * @param options options, currently ignored, may be null.
+ * @return instance of RelativeTimePatternConverter.
+ */
+ public static RelativeTimePatternConverter newInstance(
+ final String[] options) {
+ return new RelativeTimePatternConverter();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void format(final LogEvent event, final StringBuilder toAppendTo) {
+ long timestamp = event.getMillis();
+
+ synchronized (this) {
+ if (timestamp != lastTimestamp) {
+ lastTimestamp = timestamp;
+ relative = Long.toString(timestamp - startTime);
+ }
+ }
+ toAppendTo.append(relative);
+ }
+}
Added: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/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/layout/pattern/SequenceNumberPatternConverter.java?rev=943816&view=auto
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/SequenceNumberPatternConverter.java (added)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/SequenceNumberPatternConverter.java Thu May 13 06:31:04 2010
@@ -0,0 +1,60 @@
+/*
+ * 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.logging.log4j.core.layout.pattern;
+
+import org.apache.logging.log4j.core.LogEvent;
+import org.apache.logging.log4j.core.config.plugins.Plugin;
+
+
+/**
+ * Formats the event sequence number.
+ */
+@Plugin(name="SequenceNumberPatternConverter", type="Converter")
+@ConverterKeys({"sn", "sequenceNumber"})
+public class SequenceNumberPatternConverter extends LogEventPatternConverter {
+ /**
+ * Singleton.
+ */
+ private static final SequenceNumberPatternConverter INSTANCE =
+ new SequenceNumberPatternConverter();
+
+ /**
+ * Private constructor.
+ */
+ private SequenceNumberPatternConverter() {
+ super("Sequence Number", "sn");
+ }
+
+ /**
+ * Obtains an instance of SequencePatternConverter.
+ *
+ * @param options options, currently ignored, may be null.
+ * @return instance of SequencePatternConverter.
+ */
+ public static SequenceNumberPatternConverter newInstance(
+ final String[] options) {
+ return INSTANCE;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void format(final LogEvent event, final StringBuilder toAppendTo) {
+ toAppendTo.append("0");
+ }
+}
Added: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/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/layout/pattern/ThreadPatternConverter.java?rev=943816&view=auto
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/ThreadPatternConverter.java (added)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/ThreadPatternConverter.java Thu May 13 06:31:04 2010
@@ -0,0 +1,59 @@
+/*
+ * 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.logging.log4j.core.layout.pattern;
+
+import org.apache.logging.log4j.core.LogEvent;
+import org.apache.logging.log4j.core.config.plugins.Plugin;
+
+/**
+ * Formats the event thread name.
+ */
+@Plugin(name="ThreadPatternConverter", type="Converter")
+@ConverterKeys({"t", "thread"})
+public class ThreadPatternConverter extends LogEventPatternConverter {
+ /**
+ * Singleton.
+ */
+ private static final ThreadPatternConverter INSTANCE =
+ new ThreadPatternConverter();
+
+ /**
+ * Private constructor.
+ */
+ private ThreadPatternConverter() {
+ super("Thread", "thread");
+ }
+
+ /**
+ * Obtains an instance of ThreadPatternConverter.
+ *
+ * @param options options, currently ignored, may be null.
+ * @return instance of ThreadPatternConverter.
+ */
+ public static ThreadPatternConverter newInstance(
+ final String[] options) {
+ return INSTANCE;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void format(final LogEvent event, final StringBuilder toAppendTo) {
+ toAppendTo.append(event.getThreadName());
+ }
+}
Added: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/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/layout/pattern/ThrowablePatternConverter.java?rev=943816&view=auto
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/ThrowablePatternConverter.java (added)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/ThrowablePatternConverter.java Thu May 13 06:31:04 2010
@@ -0,0 +1,92 @@
+/*
+ * 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.logging.log4j.core.layout.pattern;
+
+import org.apache.logging.log4j.core.LogEvent;
+import org.apache.logging.log4j.core.config.plugins.Plugin;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
+
+/**
+ * Outputs the ThrowableInformation portion of the LoggingiEvent as a full stacktrace
+ * unless this converter's option is 'short', where it just outputs the first line of the trace.
+ */
+@Plugin(name = "ThrowablePatternConverter", type = "Converter")
+@ConverterKeys({"ex", "throwable"})
+public class ThrowablePatternConverter extends LogEventPatternConverter {
+ /**
+ * If "short", only first line of throwable report will be formatted.
+ */
+ private final String option;
+
+ /**
+ * Private constructor.
+ *
+ * @param options options, may be null.
+ */
+ private ThrowablePatternConverter(final String[] options) {
+ super("Throwable", "throwable");
+
+ if ((options != null) && (options.length > 0)) {
+ option = options[0];
+ } else {
+ option = null;
+ }
+ }
+
+ /**
+ * Gets an instance of the class.
+ *
+ * @param options pattern options, may be null. If first element is "short",
+ * only the first line of the throwable will be formatted.
+ * @return instance of class.
+ */
+ public static ThrowablePatternConverter newInstance(
+ final String[] options) {
+ return new ThrowablePatternConverter(options);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void format(final LogEvent event, final StringBuilder toAppendTo) {
+ Throwable t = event.getThrown();
+
+ if (t != null) {
+ if (option == null || option.equals("full")) {
+ StringWriter w = new StringWriter();
+ t.printStackTrace(new PrintWriter(w));
+ toAppendTo.append(w.toString());
+ } else {
+ StackTraceElement[] e = t.getStackTrace();
+ toAppendTo.append(t.toString()).append(" at ").append(e[0].toString());
+ }
+ }
+ }
+
+ /**
+ * This converter obviously handles throwables.
+ *
+ * @return true.
+ */
+ public boolean handlesThrowable() {
+ return true;
+ }
+}
Added: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/package.html
URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/package.html?rev=943816&view=auto
==============================================================================
--- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/package.html (added)
+++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-core/src/main/java/org/apache/logging/log4j/core/layout/pattern/package.html Thu May 13 06:31:04 2010
@@ -0,0 +1,11 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html> <head>
+<title></title>
+</head>
+
+<body>
+
+<p>Provides classes implementing format specifiers in conversion patterns.</p>
+
+<hr>
+</body> </html>
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org