View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements. See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache license, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License. You may obtain a copy of the License at
8    *
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the license for the specific language governing permissions and
15   * limitations under the license.
16   */
17  package org.apache.logging.log4j.core.jmx;
18  
19  /**
20   * The MBean interface for monitoring and managing an {@code Appender}.
21   */
22  public interface AppenderAdminMBean {
23      /** ObjectName pattern for AppenderAdmin MBeans. */
24      String PATTERN = "org.apache.logging.log4j2:type=LoggerContext,ctx=%s,sub=Appender,name=%s";
25  
26      /**
27       * Returns the name of the instrumented {@code Appender}.
28       * 
29       * @return the name of the Appender
30       */
31      String getName();
32  
33      /**
34       * Returns the result of calling {@code toString} on the {@code Layout}
35       * object of the instrumented {@code Appender}.
36       * 
37       * @return the {@code Layout} of the instrumented {@code Appender} as a
38       *         string
39       */
40      String getLayout();
41  
42      /**
43       * Returns how exceptions thrown on the instrumented {@code Appender} are
44       * handled.
45       * 
46       * @return {@code true} if any exceptions thrown by the Appender will be
47       *         logged or {@code false} if such exceptions are re-thrown.
48       */
49      boolean isExceptionSuppressed();
50  
51      /**
52       * Returns the result of calling {@code toString} on the error handler of
53       * this appender, or {@code "null"} if no error handler was set.
54       * 
55       * @return result of calling {@code toString} on the error handler of this
56       *         appender, or {@code "null"}
57       */
58      String getErrorHandler();
59  }