001 /*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements. See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache license, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License. You may obtain a copy of the License at
008 *
009 * http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the license for the specific language governing permissions and
015 * limitations under the license.
016 */
017 package org.apache.logging.log4j;
018
019 /**
020 * Exception thrown when an error occurs while logging. In most cases exceptions will be handled
021 * within Log4j but certain Appenders may be configured to allow exceptions to propagate to the
022 * application. This is a RuntimeException so that the exception may be thrown in those cases without
023 * requiring all Logger methods be contained with try/catch blocks.
024 */
025 public class LoggingException extends RuntimeException {
026
027 private static final long serialVersionUID = 6366395965071580537L;
028
029 /**
030 * Construct an exception with a message.
031 *
032 * @param message The reason for the exception
033 */
034 public LoggingException(final String message) {
035 super(message);
036 }
037
038 /**
039 * Construct an exception with a message and underlying cause.
040 *
041 * @param message The reason for the exception
042 * @param cause The underlying cause of the exception
043 */
044 public LoggingException(final String message, final Throwable cause) {
045 super(message, cause);
046 }
047
048 /**
049 * Construct an exception with an underlying cause.
050 *
051 * @param cause The underlying cause of the exception
052 */
053 public LoggingException(final Throwable cause) {
054 super(cause);
055 }
056 }