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 a exception 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     */
026    public class LoggingException extends RuntimeException {
027    
028        private static final long serialVersionUID = 6366395965071580537L;
029    
030        /**
031         * Constructs a LoggingException with a message.
032         * @param msg The message.
033         */
034        public LoggingException(String msg) {
035            super(msg);
036        }
037    
038        /**
039         * Constructs a LoggingException with a message and a chained Exception.
040         * @param msg The message.
041         * @param ex The chained Exception.
042         */
043        public LoggingException(String msg, Exception ex) {
044            super(msg, ex);
045        }
046    
047        /**
048         * Constructs a Logging Exception with a chained Exception and no message.
049         * @param ex The chained Exception.
050         */
051        public LoggingException(Exception ex) {
052            super(ex);
053        }
054    }