From cd4835f9c7c2706fa53180c1d0f8277385b2c3f6 Mon Sep 17 00:00:00 2001 From: AlBundy33 Date: Mon, 22 Oct 2018 15:10:29 +0200 Subject: [PATCH] [LOG4J2-2476] missing classes for 1.2 compatibility --- .../org/apache/log4j/ConsoleAppender.java | 52 +++++++++++++++++++ .../java/org/apache/log4j/SimpleLayout.java | 46 ++++++++++++++++ 2 files changed, 98 insertions(+) create mode 100644 log4j-1.2-api/src/main/java/org/apache/log4j/ConsoleAppender.java create mode 100644 log4j-1.2-api/src/main/java/org/apache/log4j/SimpleLayout.java diff --git a/log4j-1.2-api/src/main/java/org/apache/log4j/ConsoleAppender.java b/log4j-1.2-api/src/main/java/org/apache/log4j/ConsoleAppender.java new file mode 100644 index 00000000000..3f0d6c56558 --- /dev/null +++ b/log4j-1.2-api/src/main/java/org/apache/log4j/ConsoleAppender.java @@ -0,0 +1,52 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache license, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the license for the specific language governing permissions and + * limitations under the license. + */ +package org.apache.log4j; + +import org.apache.log4j.spi.LoggingEvent; + +/** + * Console-appender. + */ +public class ConsoleAppender extends AppenderSkeleton +{ + + /** + * {@inheritDoc} + */ + @Override + public void close() + { + } + + /** + * {@inheritDoc} + */ + @Override + public boolean requiresLayout() + { + return false; + } + + /** + * {@inheritDoc} + */ + @Override + protected void append(LoggingEvent theEvent) + { + } + +} diff --git a/log4j-1.2-api/src/main/java/org/apache/log4j/SimpleLayout.java b/log4j-1.2-api/src/main/java/org/apache/log4j/SimpleLayout.java new file mode 100644 index 00000000000..3888327b436 --- /dev/null +++ b/log4j-1.2-api/src/main/java/org/apache/log4j/SimpleLayout.java @@ -0,0 +1,46 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache license, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the license for the specific language governing permissions and + * limitations under the license. + */ +package org.apache.log4j; + +import org.apache.log4j.spi.LoggingEvent; +import org.apache.logging.log4j.util.Strings; + +/** + * Simple-layout. + */ +public class SimpleLayout extends Layout +{ + + /** + * {@inheritDoc} + */ + @Override + public String format(LoggingEvent theEvent) + { + return Strings.EMPTY; + } + + /** + * {@inheritDoc} + */ + @Override + public boolean ignoresThrowable() + { + return true; + } + +}