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 */
017package org.apache.logging.log4j.spi;
018
019import java.io.Serializable;
020
021import org.apache.logging.log4j.Level;
022import org.apache.logging.log4j.LoggingException;
023import org.apache.logging.log4j.Marker;
024import org.apache.logging.log4j.MarkerManager;
025import org.apache.logging.log4j.message.DefaultFlowMessageFactory;
026import org.apache.logging.log4j.message.EntryMessage;
027import org.apache.logging.log4j.message.FlowMessageFactory;
028import org.apache.logging.log4j.message.Message;
029import org.apache.logging.log4j.message.MessageFactory;
030import org.apache.logging.log4j.message.MessageFactory2;
031import org.apache.logging.log4j.message.ParameterizedMessage;
032import org.apache.logging.log4j.message.ParameterizedMessageFactory;
033import org.apache.logging.log4j.message.ReusableMessageFactory;
034import org.apache.logging.log4j.message.SimpleMessage;
035import org.apache.logging.log4j.message.StringFormattedMessage;
036import org.apache.logging.log4j.status.StatusLogger;
037import org.apache.logging.log4j.util.Constants;
038import org.apache.logging.log4j.util.LambdaUtil;
039import org.apache.logging.log4j.util.LoaderUtil;
040import org.apache.logging.log4j.util.MessageSupplier;
041import org.apache.logging.log4j.util.PerformanceSensitive;
042import org.apache.logging.log4j.util.PropertiesUtil;
043import org.apache.logging.log4j.util.Strings;
044import org.apache.logging.log4j.util.Supplier;
045
046/**
047 * Base implementation of a Logger. It is highly recommended that any Logger implementation extend this class.
048 */
049public abstract class AbstractLogger implements ExtendedLogger, Serializable {
050    // Implementation note: many methods in this class are tuned for performance. MODIFY WITH CARE!
051    // Specifically, try to keep the hot methods to 35 bytecodes or less:
052    // this is within the MaxInlineSize threshold on Java 7 and Java 8 Hotspot and makes these methods
053    // candidates for immediate inlining instead of waiting until they are designated "hot enough".
054
055    /**
056     * Marker for flow tracing.
057     */
058    public static final Marker FLOW_MARKER = MarkerManager.getMarker("FLOW");
059
060    /**
061     * Marker for method entry tracing.
062     */
063    public static final Marker ENTRY_MARKER = MarkerManager.getMarker("ENTER").setParents(FLOW_MARKER);
064
065    /**
066     * Marker for method exit tracing.
067     */
068    public static final Marker EXIT_MARKER = MarkerManager.getMarker("EXIT").setParents(FLOW_MARKER);
069
070    /**
071     * Marker for exception tracing.
072     */
073    public static final Marker EXCEPTION_MARKER = MarkerManager.getMarker("EXCEPTION");
074
075    /**
076     * Marker for throwing exceptions.
077     */
078    public static final Marker THROWING_MARKER = MarkerManager.getMarker("THROWING").setParents(EXCEPTION_MARKER);
079
080    /**
081     * Marker for catching exceptions.
082     */
083    public static final Marker CATCHING_MARKER = MarkerManager.getMarker("CATCHING").setParents(EXCEPTION_MARKER);
084
085    /**
086     * The default MessageFactory class.
087     */
088    public static final Class<? extends MessageFactory> DEFAULT_MESSAGE_FACTORY_CLASS =
089            createClassForProperty("log4j2.messageFactory", ReusableMessageFactory.class,
090                    ParameterizedMessageFactory.class);
091
092    /**
093     * The default FlowMessageFactory class.
094     */
095    public static final Class<? extends FlowMessageFactory> DEFAULT_FLOW_MESSAGE_FACTORY_CLASS =
096            createFlowClassForProperty("log4j2.flowMessageFactory", DefaultFlowMessageFactory.class);
097
098    private static final long serialVersionUID = 2L;
099
100    private static final String FQCN = AbstractLogger.class.getName();
101    private static final String THROWING = "Throwing";
102    private static final String CATCHING = "Catching";
103
104    protected final String name;
105    private final MessageFactory2 messageFactory;
106    private final FlowMessageFactory flowMessageFactory;
107    private static ThreadLocal<int[]> recursionDepthHolder = new ThreadLocal<>(); // LOG4J2-1518, LOG4J2-2031
108
109    /**
110     * Creates a new logger named after this class (or subclass).
111     */
112    public AbstractLogger() {
113        this.name = getClass().getName();
114        this.messageFactory = createDefaultMessageFactory();
115        this.flowMessageFactory = createDefaultFlowMessageFactory();
116    }
117
118    /**
119     * Creates a new named logger.
120     *
121     * @param name the logger name
122     */
123    public AbstractLogger(final String name) {
124        this(name, createDefaultMessageFactory());
125    }
126
127    /**
128     * Creates a new named logger with a particular {@link MessageFactory}.
129     *
130     * @param name the logger name
131     * @param messageFactory the message factory, if null then use the default message factory.
132     */
133    public AbstractLogger(final String name, final MessageFactory messageFactory) {
134        this.name = name;
135        this.messageFactory = messageFactory == null ? createDefaultMessageFactory() : narrow(messageFactory);
136        this.flowMessageFactory = createDefaultFlowMessageFactory();
137    }
138
139    /**
140     * Checks that the message factory a logger was created with is the same as the given messageFactory. If they are
141     * different log a warning to the {@linkplain StatusLogger}. A null MessageFactory translates to the default
142     * MessageFactory {@link #DEFAULT_MESSAGE_FACTORY_CLASS}.
143     *
144     * @param logger The logger to check
145     * @param messageFactory The message factory to check.
146     */
147    public static void checkMessageFactory(final ExtendedLogger logger, final MessageFactory messageFactory) {
148        final String name = logger.getName();
149        final MessageFactory loggerMessageFactory = logger.getMessageFactory();
150        if (messageFactory != null && !loggerMessageFactory.equals(messageFactory)) {
151            StatusLogger.getLogger().warn(
152                    "The Logger {} was created with the message factory {} and is now requested with the "
153                            + "message factory {}, which may create log events with unexpected formatting.", name,
154                    loggerMessageFactory, messageFactory);
155        } else if (messageFactory == null && !loggerMessageFactory.getClass().equals(DEFAULT_MESSAGE_FACTORY_CLASS)) {
156            StatusLogger
157                    .getLogger()
158                    .warn("The Logger {} was created with the message factory {} and is now requested with a null "
159                            + "message factory (defaults to {}), which may create log events with unexpected "
160                            + "formatting.",
161                            name, loggerMessageFactory, DEFAULT_MESSAGE_FACTORY_CLASS.getName());
162        }
163    }
164
165    @Override
166    public void catching(final Level level, final Throwable t) {
167        catching(FQCN, level, t);
168    }
169
170    /**
171     * Logs a Throwable that has been caught with location information.
172     *
173     * @param fqcn The fully qualified class name of the <b>caller</b>.
174     * @param level The logging level.
175     * @param t The Throwable.
176     */
177    protected void catching(final String fqcn, final Level level, final Throwable t) {
178        if (isEnabled(level, CATCHING_MARKER, (Object) null, null)) {
179            logMessageSafely(fqcn, level, CATCHING_MARKER, catchingMsg(t), t);
180        }
181    }
182
183    @Override
184    public void catching(final Throwable t) {
185        if (isEnabled(Level.ERROR, CATCHING_MARKER, (Object) null, null)) {
186            logMessageSafely(FQCN, Level.ERROR, CATCHING_MARKER, catchingMsg(t), t);
187        }
188    }
189
190    protected Message catchingMsg(final Throwable t) {
191        return messageFactory.newMessage(CATCHING);
192    }
193
194    private static Class<? extends MessageFactory> createClassForProperty(final String property,
195            final Class<ReusableMessageFactory> reusableParameterizedMessageFactoryClass,
196            final Class<ParameterizedMessageFactory> parameterizedMessageFactoryClass) {
197        try {
198            final String fallback = Constants.ENABLE_THREADLOCALS ? reusableParameterizedMessageFactoryClass.getName()
199                    : parameterizedMessageFactoryClass.getName();
200            final String clsName = PropertiesUtil.getProperties().getStringProperty(property, fallback);
201            return LoaderUtil.loadClass(clsName).asSubclass(MessageFactory.class);
202        } catch (final Throwable t) {
203            return parameterizedMessageFactoryClass;
204        }
205    }
206
207    private static Class<? extends FlowMessageFactory> createFlowClassForProperty(final String property,
208            final Class<DefaultFlowMessageFactory> defaultFlowMessageFactoryClass) {
209        try {
210            final String clsName = PropertiesUtil.getProperties().getStringProperty(property, defaultFlowMessageFactoryClass.getName());
211            return LoaderUtil.loadClass(clsName).asSubclass(FlowMessageFactory.class);
212        } catch (final Throwable t) {
213            return defaultFlowMessageFactoryClass;
214        }
215    }
216
217    private static MessageFactory2 createDefaultMessageFactory() {
218        try {
219            final MessageFactory result = DEFAULT_MESSAGE_FACTORY_CLASS.newInstance();
220            return narrow(result);
221        } catch (final InstantiationException | IllegalAccessException e) {
222            throw new IllegalStateException(e);
223        }
224    }
225
226    private static MessageFactory2 narrow(final MessageFactory result) {
227        if (result instanceof MessageFactory2) {
228            return (MessageFactory2) result;
229        }
230        return new MessageFactory2Adapter(result);
231    }
232
233    private static FlowMessageFactory createDefaultFlowMessageFactory() {
234        try {
235            return DEFAULT_FLOW_MESSAGE_FACTORY_CLASS.newInstance();
236        } catch (final InstantiationException | IllegalAccessException e) {
237            throw new IllegalStateException(e);
238        }
239    }
240
241    @Override
242    public void debug(final Marker marker, final CharSequence message) {
243        logIfEnabled(FQCN, Level.DEBUG, marker, message, null);
244    }
245
246    @Override
247    public void debug(final Marker marker, final CharSequence message, final Throwable t) {
248        logIfEnabled(FQCN, Level.DEBUG, marker, message, t);
249    }
250
251    @Override
252    public void debug(final Marker marker, final Message msg) {
253        logIfEnabled(FQCN, Level.DEBUG, marker, msg, msg != null ? msg.getThrowable() : null);
254    }
255
256    @Override
257    public void debug(final Marker marker, final Message msg, final Throwable t) {
258        logIfEnabled(FQCN, Level.DEBUG, marker, msg, t);
259    }
260
261    @Override
262    public void debug(final Marker marker, final Object message) {
263        logIfEnabled(FQCN, Level.DEBUG, marker, message, null);
264    }
265
266    @Override
267    public void debug(final Marker marker, final Object message, final Throwable t) {
268        logIfEnabled(FQCN, Level.DEBUG, marker, message, t);
269    }
270
271    @Override
272    public void debug(final Marker marker, final String message) {
273        logIfEnabled(FQCN, Level.DEBUG, marker, message, (Throwable) null);
274    }
275
276    @Override
277    public void debug(final Marker marker, final String message, final Object... params) {
278        logIfEnabled(FQCN, Level.DEBUG, marker, message, params);
279    }
280
281    @Override
282    public void debug(final Marker marker, final String message, final Throwable t) {
283        logIfEnabled(FQCN, Level.DEBUG, marker, message, t);
284    }
285
286    @Override
287    public void debug(final Message msg) {
288        logIfEnabled(FQCN, Level.DEBUG, null, msg, msg != null ? msg.getThrowable() : null);
289    }
290
291    @Override
292    public void debug(final Message msg, final Throwable t) {
293        logIfEnabled(FQCN, Level.DEBUG, null, msg, t);
294    }
295
296    @Override
297    public void debug(final CharSequence message) {
298        logIfEnabled(FQCN, Level.DEBUG, null, message, null);
299    }
300
301    @Override
302    public void debug(final CharSequence message, final Throwable t) {
303        logIfEnabled(FQCN, Level.DEBUG, null, message, t);
304    }
305
306    @Override
307    public void debug(final Object message) {
308        logIfEnabled(FQCN, Level.DEBUG, null, message, null);
309    }
310
311    @Override
312    public void debug(final Object message, final Throwable t) {
313        logIfEnabled(FQCN, Level.DEBUG, null, message, t);
314    }
315
316    @Override
317    public void debug(final String message) {
318        logIfEnabled(FQCN, Level.DEBUG, null, message, (Throwable) null);
319    }
320
321    @Override
322    public void debug(final String message, final Object... params) {
323        logIfEnabled(FQCN, Level.DEBUG, null, message, params);
324    }
325
326    @Override
327    public void debug(final String message, final Throwable t) {
328        logIfEnabled(FQCN, Level.DEBUG, null, message, t);
329    }
330
331    @Override
332    public void debug(final Supplier<?> msgSupplier) {
333        logIfEnabled(FQCN, Level.DEBUG, null, msgSupplier, (Throwable) null);
334    }
335
336    @Override
337    public void debug(final Supplier<?> msgSupplier, final Throwable t) {
338        logIfEnabled(FQCN, Level.DEBUG, null, msgSupplier, t);
339    }
340
341    @Override
342    public void debug(final Marker marker, final Supplier<?> msgSupplier) {
343        logIfEnabled(FQCN, Level.DEBUG, marker, msgSupplier, (Throwable) null);
344    }
345
346    @Override
347    public void debug(final Marker marker, final String message, final Supplier<?>... paramSuppliers) {
348        logIfEnabled(FQCN, Level.DEBUG, marker, message, paramSuppliers);
349    }
350
351    @Override
352    public void debug(final Marker marker, final Supplier<?> msgSupplier, final Throwable t) {
353        logIfEnabled(FQCN, Level.DEBUG, marker, msgSupplier, t);
354    }
355
356    @Override
357    public void debug(final String message, final Supplier<?>... paramSuppliers) {
358        logIfEnabled(FQCN, Level.DEBUG, null, message, paramSuppliers);
359    }
360
361    @Override
362    public void debug(final Marker marker, final MessageSupplier msgSupplier) {
363        logIfEnabled(FQCN, Level.DEBUG, marker, msgSupplier, (Throwable) null);
364    }
365
366    @Override
367    public void debug(final Marker marker, final MessageSupplier msgSupplier, final Throwable t) {
368        logIfEnabled(FQCN, Level.DEBUG, marker, msgSupplier, t);
369    }
370
371    @Override
372    public void debug(final MessageSupplier msgSupplier) {
373        logIfEnabled(FQCN, Level.DEBUG, null, msgSupplier, (Throwable) null);
374    }
375
376    @Override
377    public void debug(final MessageSupplier msgSupplier, final Throwable t) {
378        logIfEnabled(FQCN, Level.DEBUG, null, msgSupplier, t);
379    }
380
381    @Override
382    public void debug(final Marker marker, final String message, final Object p0) {
383        logIfEnabled(FQCN, Level.DEBUG, marker, message, p0);
384    }
385
386    @Override
387    public void debug(final Marker marker, final String message, final Object p0, final Object p1) {
388        logIfEnabled(FQCN, Level.DEBUG, marker, message, p0, p1);
389    }
390
391    @Override
392    public void debug(final Marker marker, final String message, final Object p0, final Object p1, final Object p2) {
393        logIfEnabled(FQCN, Level.DEBUG, marker, message, p0, p1, p2);
394    }
395
396    @Override
397    public void debug(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
398            final Object p3) {
399        logIfEnabled(FQCN, Level.DEBUG, marker, message, p0, p1, p2, p3);
400    }
401
402    @Override
403    public void debug(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
404            final Object p3, final Object p4) {
405        logIfEnabled(FQCN, Level.DEBUG, marker, message, p0, p1, p2, p3, p4);
406    }
407
408    @Override
409    public void debug(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
410            final Object p3, final Object p4, final Object p5) {
411        logIfEnabled(FQCN, Level.DEBUG, marker, message, p0, p1, p2, p3, p4, p5);
412    }
413
414    @Override
415    public void debug(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
416            final Object p3, final Object p4, final Object p5,
417            final Object p6) {
418        logIfEnabled(FQCN, Level.DEBUG, marker, message, p0, p1, p2, p3, p4, p5, p6);
419    }
420
421    @Override
422    public void debug(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
423            final Object p3, final Object p4, final Object p5,
424            final Object p6, final Object p7) {
425        logIfEnabled(FQCN, Level.DEBUG, marker, message, p0, p1, p2, p3, p4, p5, p6, p7);
426    }
427
428    @Override
429    public void debug(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
430            final Object p3, final Object p4, final Object p5,
431            final Object p6, final Object p7, final Object p8) {
432        logIfEnabled(FQCN, Level.DEBUG, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8);
433    }
434
435    @Override
436    public void debug(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
437            final Object p3, final Object p4, final Object p5,
438            final Object p6, final Object p7, final Object p8, final Object p9) {
439        logIfEnabled(FQCN, Level.DEBUG, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
440    }
441
442    @Override
443    public void debug(final String message, final Object p0) {
444        logIfEnabled(FQCN, Level.DEBUG, null, message, p0);
445    }
446
447    @Override
448    public void debug(final String message, final Object p0, final Object p1) {
449        logIfEnabled(FQCN, Level.DEBUG, null, message, p0, p1);
450    }
451
452    @Override
453    public void debug(final String message, final Object p0, final Object p1, final Object p2) {
454        logIfEnabled(FQCN, Level.DEBUG, null, message, p0, p1, p2);
455    }
456
457    @Override
458    public void debug(final String message, final Object p0, final Object p1, final Object p2, final Object p3) {
459        logIfEnabled(FQCN, Level.DEBUG, null, message, p0, p1, p2, p3);
460    }
461
462    @Override
463    public void debug(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
464            final Object p4) {
465        logIfEnabled(FQCN, Level.DEBUG, null, message, p0, p1, p2, p3, p4);
466    }
467
468    @Override
469    public void debug(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
470            final Object p4, final Object p5) {
471        logIfEnabled(FQCN, Level.DEBUG, null, message, p0, p1, p2, p3, p4, p5);
472    }
473
474    @Override
475    public void debug(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
476            final Object p4, final Object p5, final Object p6) {
477        logIfEnabled(FQCN, Level.DEBUG, null, message, p0, p1, p2, p3, p4, p5, p6);
478    }
479
480    @Override
481    public void debug(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
482            final Object p4, final Object p5, final Object p6,
483            final Object p7) {
484        logIfEnabled(FQCN, Level.DEBUG, null, message, p0, p1, p2, p3, p4, p5, p6, p7);
485    }
486
487    @Override
488    public void debug(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
489            final Object p4, final Object p5, final Object p6,
490            final Object p7, final Object p8) {
491        logIfEnabled(FQCN, Level.DEBUG, null, message, p0, p1, p2, p3, p4, p5, p6, p7, p8);
492    }
493
494    @Override
495    public void debug(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
496            final Object p4, final Object p5, final Object p6,
497            final Object p7, final Object p8, final Object p9) {
498        logIfEnabled(FQCN, Level.DEBUG, null, message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
499    }
500
501    /**
502     * Logs entry to a method with location information.
503     *
504     * @param fqcn The fully qualified class name of the <b>caller</b>.
505     * @param format Format String for the parameters.
506     * @param paramSuppliers The Suppliers of the parameters.
507     */
508    protected EntryMessage enter(final String fqcn, final String format, final Supplier<?>... paramSuppliers) {
509        EntryMessage entryMsg = null;
510        if (isEnabled(Level.TRACE, ENTRY_MARKER, (Object) null, null)) {
511            logMessageSafely(fqcn, Level.TRACE, ENTRY_MARKER, entryMsg = entryMsg(format, paramSuppliers), null);
512        }
513        return entryMsg;
514    }
515
516    /**
517     * Logs entry to a method with location information.
518     *
519     * @param fqcn The fully qualified class name of the <b>caller</b>.
520     * @param format The format String for the parameters.
521     * @param paramSuppliers The parameters to the method.
522     */
523    @Deprecated
524    protected EntryMessage enter(final String fqcn, final String format, final MessageSupplier... paramSuppliers) {
525        EntryMessage entryMsg = null;
526        if (isEnabled(Level.TRACE, ENTRY_MARKER, (Object) null, null)) {
527            logMessageSafely(fqcn, Level.TRACE, ENTRY_MARKER, entryMsg = entryMsg(format, paramSuppliers), null);
528        }
529        return entryMsg;
530    }
531
532    /**
533     * Logs entry to a method with location information.
534     *
535     * @param fqcn The fully qualified class name of the <b>caller</b>.
536     * @param format The format String for the parameters.
537     * @param params The parameters to the method.
538     */
539    protected EntryMessage enter(final String fqcn, final String format, final Object... params) {
540        EntryMessage entryMsg = null;
541        if (isEnabled(Level.TRACE, ENTRY_MARKER, (Object) null, null)) {
542            logMessageSafely(fqcn, Level.TRACE, ENTRY_MARKER, entryMsg = entryMsg(format, params), null);
543        }
544        return entryMsg;
545    }
546
547    /**
548     * Logs entry to a method with location information.
549     *
550     * @param fqcn The fully qualified class name of the <b>caller</b>.
551     * @param msgSupplier The Supplier of the Message.
552     */
553    @Deprecated
554    protected EntryMessage enter(final String fqcn, final MessageSupplier msgSupplier) {
555        EntryMessage message = null;
556        if (isEnabled(Level.TRACE, ENTRY_MARKER, (Object) null, null)) {
557            logMessageSafely(fqcn, Level.TRACE, ENTRY_MARKER, message = flowMessageFactory.newEntryMessage(
558                    msgSupplier.get()), null);
559        }
560        return message;
561    }
562
563    /**
564     * Logs entry to a method with location information.
565     *
566     * @param fqcn
567     *            The fully qualified class name of the <b>caller</b>.
568     * @param message
569     *            the Message.
570     * @since 2.6
571     */
572    protected EntryMessage enter(final String fqcn, final Message message) {
573        EntryMessage flowMessage = null;
574        if (isEnabled(Level.TRACE, ENTRY_MARKER, (Object) null, null)) {
575            logMessageSafely(fqcn, Level.TRACE, ENTRY_MARKER, flowMessage = flowMessageFactory.newEntryMessage(message),
576                    null);
577        }
578        return flowMessage;
579    }
580
581    @Deprecated
582    @Override
583    public void entry() {
584        entry(FQCN, (Object[]) null);
585    }
586
587    @Override
588    public void entry(final Object... params) {
589        entry(FQCN, params);
590    }
591
592    /**
593     * Logs entry to a method with location information.
594     *
595     * @param fqcn The fully qualified class name of the <b>caller</b>.
596     * @param params The parameters to the method.
597     */
598    protected void entry(final String fqcn, final Object... params) {
599        if (isEnabled(Level.TRACE, ENTRY_MARKER, (Object) null, null)) {
600            if (params == null) {
601                logMessageSafely(fqcn, Level.TRACE, ENTRY_MARKER, entryMsg(null, (Supplier<?>[]) null), null);
602            } else {
603                logMessageSafely(fqcn, Level.TRACE, ENTRY_MARKER, entryMsg(null, params), null);
604            }
605        }
606    }
607
608    protected EntryMessage entryMsg(final String format, final Object... params) {
609        final int count = params == null ? 0 : params.length;
610        if (count == 0) {
611            if (Strings.isEmpty(format)) {
612                return flowMessageFactory.newEntryMessage(null);
613            }
614            return flowMessageFactory.newEntryMessage(new SimpleMessage(format));
615        }
616        if (format != null) {
617            return flowMessageFactory.newEntryMessage(new ParameterizedMessage(format, params));
618        }
619        final StringBuilder sb = new StringBuilder();
620        sb.append("params(");
621        for (int i = 0; i < count; i++) {
622            if (i > 0) {
623                sb.append(", ");
624            }
625            final Object parm = params[i];
626            sb.append(parm instanceof Message ? ((Message) parm).getFormattedMessage() : String.valueOf(parm));
627        }
628        sb.append(')');
629        return flowMessageFactory.newEntryMessage(new SimpleMessage(sb));
630    }
631
632    protected EntryMessage entryMsg(final String format, final MessageSupplier... paramSuppliers) {
633        final int count = paramSuppliers == null ? 0 : paramSuppliers.length;
634        final Object[] params = new Object[count];
635        for (int i = 0; i < count; i++) {
636            params[i] = paramSuppliers[i].get();
637            params[i] = params[i] != null ? ((Message) params[i]).getFormattedMessage() : null;
638        }
639        return entryMsg(format, params);
640    }
641
642    protected EntryMessage entryMsg(final String format, final Supplier<?>... paramSuppliers) {
643        final int count = paramSuppliers == null ? 0 : paramSuppliers.length;
644        final Object[] params = new Object[count];
645        for (int i = 0; i < count; i++) {
646            params[i] = paramSuppliers[i].get();
647            if (params[i] instanceof Message) {
648                params[i] = ((Message) params[i]).getFormattedMessage();
649            }
650        }
651        return entryMsg(format, params);
652    }
653
654    @Override
655    public void error(final Marker marker, final Message msg) {
656        logIfEnabled(FQCN, Level.ERROR, marker, msg, msg != null ? msg.getThrowable() : null);
657    }
658
659    @Override
660    public void error(final Marker marker, final Message msg, final Throwable t) {
661        logIfEnabled(FQCN, Level.ERROR, marker, msg, t);
662    }
663
664    @Override
665    public void error(final Marker marker, final CharSequence message) {
666        logIfEnabled(FQCN, Level.ERROR, marker, message, null);
667    }
668
669    @Override
670    public void error(final Marker marker, final CharSequence message, final Throwable t) {
671        logIfEnabled(FQCN, Level.ERROR, marker, message, t);
672    }
673
674    @Override
675    public void error(final Marker marker, final Object message) {
676        logIfEnabled(FQCN, Level.ERROR, marker, message, null);
677    }
678
679    @Override
680    public void error(final Marker marker, final Object message, final Throwable t) {
681        logIfEnabled(FQCN, Level.ERROR, marker, message, t);
682    }
683
684    @Override
685    public void error(final Marker marker, final String message) {
686        logIfEnabled(FQCN, Level.ERROR, marker, message, (Throwable) null);
687    }
688
689    @Override
690    public void error(final Marker marker, final String message, final Object... params) {
691        logIfEnabled(FQCN, Level.ERROR, marker, message, params);
692    }
693
694    @Override
695    public void error(final Marker marker, final String message, final Throwable t) {
696        logIfEnabled(FQCN, Level.ERROR, marker, message, t);
697    }
698
699    @Override
700    public void error(final Message msg) {
701        logIfEnabled(FQCN, Level.ERROR, null, msg, msg != null ? msg.getThrowable() : null);
702    }
703
704    @Override
705    public void error(final Message msg, final Throwable t) {
706        logIfEnabled(FQCN, Level.ERROR, null, msg, t);
707    }
708
709    @Override
710    public void error(final CharSequence message) {
711        logIfEnabled(FQCN, Level.ERROR, null, message, null);
712    }
713
714    @Override
715    public void error(final CharSequence message, final Throwable t) {
716        logIfEnabled(FQCN, Level.ERROR, null, message, t);
717    }
718
719    @Override
720    public void error(final Object message) {
721        logIfEnabled(FQCN, Level.ERROR, null, message, null);
722    }
723
724    @Override
725    public void error(final Object message, final Throwable t) {
726        logIfEnabled(FQCN, Level.ERROR, null, message, t);
727    }
728
729    @Override
730    public void error(final String message) {
731        logIfEnabled(FQCN, Level.ERROR, null, message, (Throwable) null);
732    }
733
734    @Override
735    public void error(final String message, final Object... params) {
736        logIfEnabled(FQCN, Level.ERROR, null, message, params);
737    }
738
739    @Override
740    public void error(final String message, final Throwable t) {
741        logIfEnabled(FQCN, Level.ERROR, null, message, t);
742    }
743
744    @Override
745    public void error(final Supplier<?> msgSupplier) {
746        logIfEnabled(FQCN, Level.ERROR, null, msgSupplier, (Throwable) null);
747    }
748
749    @Override
750    public void error(final Supplier<?> msgSupplier, final Throwable t) {
751        logIfEnabled(FQCN, Level.ERROR, null, msgSupplier, t);
752    }
753
754    @Override
755    public void error(final Marker marker, final Supplier<?> msgSupplier) {
756        logIfEnabled(FQCN, Level.ERROR, marker, msgSupplier, (Throwable) null);
757    }
758
759    @Override
760    public void error(final Marker marker, final String message, final Supplier<?>... paramSuppliers) {
761        logIfEnabled(FQCN, Level.ERROR, marker, message, paramSuppliers);
762    }
763
764    @Override
765    public void error(final Marker marker, final Supplier<?> msgSupplier, final Throwable t) {
766        logIfEnabled(FQCN, Level.ERROR, marker, msgSupplier, t);
767    }
768
769    @Override
770    public void error(final String message, final Supplier<?>... paramSuppliers) {
771        logIfEnabled(FQCN, Level.ERROR, null, message, paramSuppliers);
772    }
773
774    @Override
775    public void error(final Marker marker, final MessageSupplier msgSupplier) {
776        logIfEnabled(FQCN, Level.ERROR, marker, msgSupplier, (Throwable) null);
777    }
778
779    @Override
780    public void error(final Marker marker, final MessageSupplier msgSupplier, final Throwable t) {
781        logIfEnabled(FQCN, Level.ERROR, marker, msgSupplier, t);
782    }
783
784    @Override
785    public void error(final MessageSupplier msgSupplier) {
786        logIfEnabled(FQCN, Level.ERROR, null, msgSupplier, (Throwable) null);
787    }
788
789    @Override
790    public void error(final MessageSupplier msgSupplier, final Throwable t) {
791        logIfEnabled(FQCN, Level.ERROR, null, msgSupplier, t);
792    }
793
794    @Override
795    public void error(final Marker marker, final String message, final Object p0) {
796        logIfEnabled(FQCN, Level.ERROR, marker, message, p0);
797    }
798
799    @Override
800    public void error(final Marker marker, final String message, final Object p0, final Object p1) {
801        logIfEnabled(FQCN, Level.ERROR, marker, message, p0, p1);
802    }
803
804    @Override
805    public void error(final Marker marker, final String message, final Object p0, final Object p1, final Object p2) {
806        logIfEnabled(FQCN, Level.ERROR, marker, message, p0, p1, p2);
807    }
808
809    @Override
810    public void error(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
811            final Object p3) {
812        logIfEnabled(FQCN, Level.ERROR, marker, message, p0, p1, p2, p3);
813    }
814
815    @Override
816    public void error(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
817            final Object p3, final Object p4) {
818        logIfEnabled(FQCN, Level.ERROR, marker, message, p0, p1, p2, p3, p4);
819    }
820
821    @Override
822    public void error(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
823            final Object p3, final Object p4, final Object p5) {
824        logIfEnabled(FQCN, Level.ERROR, marker, message, p0, p1, p2, p3, p4, p5);
825    }
826
827    @Override
828    public void error(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
829            final Object p3, final Object p4, final Object p5,
830            final Object p6) {
831        logIfEnabled(FQCN, Level.ERROR, marker, message, p0, p1, p2, p3, p4, p5, p6);
832    }
833
834    @Override
835    public void error(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
836            final Object p3, final Object p4, final Object p5,
837            final Object p6, final Object p7) {
838        logIfEnabled(FQCN, Level.ERROR, marker, message, p0, p1, p2, p3, p4, p5, p6, p7);
839    }
840
841    @Override
842    public void error(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
843            final Object p3, final Object p4, final Object p5,
844            final Object p6, final Object p7, final Object p8) {
845        logIfEnabled(FQCN, Level.ERROR, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8);
846    }
847
848    @Override
849    public void error(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
850            final Object p3, final Object p4, final Object p5,
851            final Object p6, final Object p7, final Object p8, final Object p9) {
852        logIfEnabled(FQCN, Level.ERROR, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
853    }
854
855    @Override
856    public void error(final String message, final Object p0) {
857        logIfEnabled(FQCN, Level.ERROR, null, message, p0);
858    }
859
860    @Override
861    public void error(final String message, final Object p0, final Object p1) {
862        logIfEnabled(FQCN, Level.ERROR, null, message, p0, p1);
863    }
864
865    @Override
866    public void error(final String message, final Object p0, final Object p1, final Object p2) {
867        logIfEnabled(FQCN, Level.ERROR, null, message, p0, p1, p2);
868    }
869
870    @Override
871    public void error(final String message, final Object p0, final Object p1, final Object p2, final Object p3) {
872        logIfEnabled(FQCN, Level.ERROR, null, message, p0, p1, p2, p3);
873    }
874
875    @Override
876    public void error(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
877            final Object p4) {
878        logIfEnabled(FQCN, Level.ERROR, null, message, p0, p1, p2, p3, p4);
879    }
880
881    @Override
882    public void error(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
883            final Object p4, final Object p5) {
884        logIfEnabled(FQCN, Level.ERROR, null, message, p0, p1, p2, p3, p4, p5);
885    }
886
887    @Override
888    public void error(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
889            final Object p4, final Object p5, final Object p6) {
890        logIfEnabled(FQCN, Level.ERROR, null, message, p0, p1, p2, p3, p4, p5, p6);
891    }
892
893    @Override
894    public void error(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
895            final Object p4, final Object p5, final Object p6, final Object p7) {
896        logIfEnabled(FQCN, Level.ERROR, null, message, p0, p1, p2, p3, p4, p5, p6, p7);
897    }
898
899    @Override
900    public void error(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
901            final Object p4, final Object p5, final Object p6, final Object p7, final Object p8) {
902        logIfEnabled(FQCN, Level.ERROR, null, message, p0, p1, p2, p3, p4, p5, p6, p7, p8);
903    }
904
905    @Override
906    public void error(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
907            final Object p4, final Object p5, final Object p6, final Object p7, final Object p8, final Object p9) {
908        logIfEnabled(FQCN, Level.ERROR, null, message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
909    }
910
911    @Deprecated
912    @Override
913    public void exit() {
914        exit(FQCN, (Object) null);
915    }
916
917    @Deprecated
918    @Override
919    public <R> R exit(final R result) {
920        return exit(FQCN, result);
921    }
922
923    /**
924     * Logs exiting from a method with the result and location information.
925     *
926     * @param fqcn The fully qualified class name of the <b>caller</b>.
927     * @param <R> The type of the parameter and object being returned.
928     * @param result The result being returned from the method call.
929     * @return the return value passed to this method.
930     */
931    protected <R> R exit(final String fqcn, final R result) {
932        if (isEnabled(Level.TRACE, EXIT_MARKER, (CharSequence) null, null)) {
933            logMessageSafely(fqcn, Level.TRACE, EXIT_MARKER, exitMsg(null, result), null);
934        }
935        return result;
936    }
937
938    /**
939     * Logs exiting from a method with the result and location information.
940     *
941     * @param fqcn The fully qualified class name of the <b>caller</b>.
942     * @param <R> The type of the parameter and object being returned.
943     * @param result The result being returned from the method call.
944     * @return the return value passed to this method.
945     */
946    protected <R> R exit(final String fqcn, final String format, final R result) {
947        if (isEnabled(Level.TRACE, EXIT_MARKER, (CharSequence) null, null)) {
948            logMessageSafely(fqcn, Level.TRACE, EXIT_MARKER, exitMsg(format, result), null);
949        }
950        return result;
951    }
952
953    protected Message exitMsg(final String format, final Object result) {
954        if (result == null) {
955            if (format == null) {
956                return messageFactory.newMessage("Exit");
957            }
958            return messageFactory.newMessage("Exit: " + format);
959        }
960        if (format == null) {
961            return messageFactory.newMessage("Exit with(" + result + ')');
962        }
963        return messageFactory.newMessage("Exit: " + format, result);
964
965    }
966
967    @Override
968    public void fatal(final Marker marker, final Message msg) {
969        logIfEnabled(FQCN, Level.FATAL, marker, msg, msg != null ? msg.getThrowable() : null);
970    }
971
972    @Override
973    public void fatal(final Marker marker, final Message msg, final Throwable t) {
974        logIfEnabled(FQCN, Level.FATAL, marker, msg, t);
975    }
976
977    @Override
978    public void fatal(final Marker marker, final CharSequence message) {
979        logIfEnabled(FQCN, Level.FATAL, marker, message, null);
980    }
981
982    @Override
983    public void fatal(final Marker marker, final CharSequence message, final Throwable t) {
984        logIfEnabled(FQCN, Level.FATAL, marker, message, t);
985    }
986
987    @Override
988    public void fatal(final Marker marker, final Object message) {
989        logIfEnabled(FQCN, Level.FATAL, marker, message, null);
990    }
991
992    @Override
993    public void fatal(final Marker marker, final Object message, final Throwable t) {
994        logIfEnabled(FQCN, Level.FATAL, marker, message, t);
995    }
996
997    @Override
998    public void fatal(final Marker marker, final String message) {
999        logIfEnabled(FQCN, Level.FATAL, marker, message, (Throwable) null);
1000    }
1001
1002    @Override
1003    public void fatal(final Marker marker, final String message, final Object... params) {
1004        logIfEnabled(FQCN, Level.FATAL, marker, message, params);
1005    }
1006
1007    @Override
1008    public void fatal(final Marker marker, final String message, final Throwable t) {
1009        logIfEnabled(FQCN, Level.FATAL, marker, message, t);
1010    }
1011
1012    @Override
1013    public void fatal(final Message msg) {
1014        logIfEnabled(FQCN, Level.FATAL, null, msg, msg != null ? msg.getThrowable() : null);
1015    }
1016
1017    @Override
1018    public void fatal(final Message msg, final Throwable t) {
1019        logIfEnabled(FQCN, Level.FATAL, null, msg, t);
1020    }
1021
1022    @Override
1023    public void fatal(final CharSequence message) {
1024        logIfEnabled(FQCN, Level.FATAL, null, message, null);
1025    }
1026
1027    @Override
1028    public void fatal(final CharSequence message, final Throwable t) {
1029        logIfEnabled(FQCN, Level.FATAL, null, message, t);
1030    }
1031
1032    @Override
1033    public void fatal(final Object message) {
1034        logIfEnabled(FQCN, Level.FATAL, null, message, null);
1035    }
1036
1037    @Override
1038    public void fatal(final Object message, final Throwable t) {
1039        logIfEnabled(FQCN, Level.FATAL, null, message, t);
1040    }
1041
1042    @Override
1043    public void fatal(final String message) {
1044        logIfEnabled(FQCN, Level.FATAL, null, message, (Throwable) null);
1045    }
1046
1047    @Override
1048    public void fatal(final String message, final Object... params) {
1049        logIfEnabled(FQCN, Level.FATAL, null, message, params);
1050    }
1051
1052    @Override
1053    public void fatal(final String message, final Throwable t) {
1054        logIfEnabled(FQCN, Level.FATAL, null, message, t);
1055    }
1056
1057    @Override
1058    public void fatal(final Supplier<?> msgSupplier) {
1059        logIfEnabled(FQCN, Level.FATAL, null, msgSupplier, (Throwable) null);
1060    }
1061
1062    @Override
1063    public void fatal(final Supplier<?> msgSupplier, final Throwable t) {
1064        logIfEnabled(FQCN, Level.FATAL, null, msgSupplier, t);
1065    }
1066
1067    @Override
1068    public void fatal(final Marker marker, final Supplier<?> msgSupplier) {
1069        logIfEnabled(FQCN, Level.FATAL, marker, msgSupplier, (Throwable) null);
1070    }
1071
1072    @Override
1073    public void fatal(final Marker marker, final String message, final Supplier<?>... paramSuppliers) {
1074        logIfEnabled(FQCN, Level.FATAL, marker, message, paramSuppliers);
1075    }
1076
1077    @Override
1078    public void fatal(final Marker marker, final Supplier<?> msgSupplier, final Throwable t) {
1079        logIfEnabled(FQCN, Level.FATAL, marker, msgSupplier, t);
1080    }
1081
1082    @Override
1083    public void fatal(final String message, final Supplier<?>... paramSuppliers) {
1084        logIfEnabled(FQCN, Level.FATAL, null, message, paramSuppliers);
1085    }
1086
1087    @Override
1088    public void fatal(final Marker marker, final MessageSupplier msgSupplier) {
1089        logIfEnabled(FQCN, Level.FATAL, marker, msgSupplier, (Throwable) null);
1090    }
1091
1092    @Override
1093    public void fatal(final Marker marker, final MessageSupplier msgSupplier, final Throwable t) {
1094        logIfEnabled(FQCN, Level.FATAL, marker, msgSupplier, t);
1095    }
1096
1097    @Override
1098    public void fatal(final MessageSupplier msgSupplier) {
1099        logIfEnabled(FQCN, Level.FATAL, null, msgSupplier, (Throwable) null);
1100    }
1101
1102    @Override
1103    public void fatal(final MessageSupplier msgSupplier, final Throwable t) {
1104        logIfEnabled(FQCN, Level.FATAL, null, msgSupplier, t);
1105    }
1106
1107    @Override
1108    public void fatal(final Marker marker, final String message, final Object p0) {
1109        logIfEnabled(FQCN, Level.FATAL, marker, message, p0);
1110    }
1111
1112    @Override
1113    public void fatal(final Marker marker, final String message, final Object p0, final Object p1) {
1114        logIfEnabled(FQCN, Level.FATAL, marker, message, p0, p1);
1115    }
1116
1117    @Override
1118    public void fatal(final Marker marker, final String message, final Object p0, final Object p1, final Object p2) {
1119        logIfEnabled(FQCN, Level.FATAL, marker, message, p0, p1, p2);
1120    }
1121
1122    @Override
1123    public void fatal(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
1124            final Object p3) {
1125        logIfEnabled(FQCN, Level.FATAL, marker, message, p0, p1, p2, p3);
1126    }
1127
1128    @Override
1129    public void fatal(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
1130            final Object p3, final Object p4) {
1131        logIfEnabled(FQCN, Level.FATAL, marker, message, p0, p1, p2, p3, p4);
1132    }
1133
1134    @Override
1135    public void fatal(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
1136            final Object p3, final Object p4, final Object p5) {
1137        logIfEnabled(FQCN, Level.FATAL, marker, message, p0, p1, p2, p3, p4, p5);
1138    }
1139
1140    @Override
1141    public void fatal(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
1142            final Object p3, final Object p4, final Object p5, final Object p6) {
1143        logIfEnabled(FQCN, Level.FATAL, marker, message, p0, p1, p2, p3, p4, p5, p6);
1144    }
1145
1146    @Override
1147    public void fatal(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
1148            final Object p3, final Object p4, final Object p5, final Object p6, final Object p7) {
1149        logIfEnabled(FQCN, Level.FATAL, marker, message, p0, p1, p2, p3, p4, p5, p6, p7);
1150    }
1151
1152    @Override
1153    public void fatal(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
1154            final Object p3, final Object p4, final Object p5,
1155            final Object p6, final Object p7, final Object p8) {
1156        logIfEnabled(FQCN, Level.FATAL, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8);
1157    }
1158
1159    @Override
1160    public void fatal(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
1161            final Object p3, final Object p4, final Object p5,
1162            final Object p6, final Object p7, final Object p8, final Object p9) {
1163        logIfEnabled(FQCN, Level.FATAL, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
1164    }
1165
1166    @Override
1167    public void fatal(final String message, final Object p0) {
1168        logIfEnabled(FQCN, Level.FATAL, null, message, p0);
1169    }
1170
1171    @Override
1172    public void fatal(final String message, final Object p0, final Object p1) {
1173        logIfEnabled(FQCN, Level.FATAL, null, message, p0, p1);
1174    }
1175
1176    @Override
1177    public void fatal(final String message, final Object p0, final Object p1, final Object p2) {
1178        logIfEnabled(FQCN, Level.FATAL, null, message, p0, p1, p2);
1179    }
1180
1181    @Override
1182    public void fatal(final String message, final Object p0, final Object p1, final Object p2, final Object p3) {
1183        logIfEnabled(FQCN, Level.FATAL, null, message, p0, p1, p2, p3);
1184    }
1185
1186    @Override
1187    public void fatal(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1188            final Object p4) {
1189        logIfEnabled(FQCN, Level.FATAL, null, message, p0, p1, p2, p3, p4);
1190    }
1191
1192    @Override
1193    public void fatal(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1194            final Object p4, final Object p5) {
1195        logIfEnabled(FQCN, Level.FATAL, null, message, p0, p1, p2, p3, p4, p5);
1196    }
1197
1198    @Override
1199    public void fatal(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1200            final Object p4, final Object p5, final Object p6) {
1201        logIfEnabled(FQCN, Level.FATAL, null, message, p0, p1, p2, p3, p4, p5, p6);
1202    }
1203
1204    @Override
1205    public void fatal(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1206            final Object p4, final Object p5, final Object p6, final Object p7) {
1207        logIfEnabled(FQCN, Level.FATAL, null, message, p0, p1, p2, p3, p4, p5, p6, p7);
1208    }
1209
1210    @Override
1211    public void fatal(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1212            final Object p4, final Object p5, final Object p6, final Object p7, final Object p8) {
1213        logIfEnabled(FQCN, Level.FATAL, null, message, p0, p1, p2, p3, p4, p5, p6, p7, p8);
1214    }
1215
1216    @Override
1217    public void fatal(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1218            final Object p4, final Object p5, final Object p6,
1219            final Object p7, final Object p8, final Object p9) {
1220        logIfEnabled(FQCN, Level.FATAL, null, message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
1221    }
1222
1223    @SuppressWarnings("unchecked")
1224    @Override
1225    public <MF extends MessageFactory> MF getMessageFactory() {
1226        return (MF) messageFactory;
1227    }
1228
1229    @Override
1230    public String getName() {
1231        return name;
1232    }
1233
1234    @Override
1235    public void info(final Marker marker, final Message msg) {
1236        logIfEnabled(FQCN, Level.INFO, marker, msg, msg != null ? msg.getThrowable() : null);
1237    }
1238
1239    @Override
1240    public void info(final Marker marker, final Message msg, final Throwable t) {
1241        logIfEnabled(FQCN, Level.INFO, marker, msg, t);
1242    }
1243
1244    @Override
1245    public void info(final Marker marker, final CharSequence message) {
1246        logIfEnabled(FQCN, Level.INFO, marker, message, null);
1247    }
1248
1249    @Override
1250    public void info(final Marker marker, final CharSequence message, final Throwable t) {
1251        logIfEnabled(FQCN, Level.INFO, marker, message, t);
1252    }
1253
1254    @Override
1255    public void info(final Marker marker, final Object message) {
1256        logIfEnabled(FQCN, Level.INFO, marker, message, null);
1257    }
1258
1259    @Override
1260    public void info(final Marker marker, final Object message, final Throwable t) {
1261        logIfEnabled(FQCN, Level.INFO, marker, message, t);
1262    }
1263
1264    @Override
1265    public void info(final Marker marker, final String message) {
1266        logIfEnabled(FQCN, Level.INFO, marker, message, (Throwable) null);
1267    }
1268
1269    @Override
1270    public void info(final Marker marker, final String message, final Object... params) {
1271        logIfEnabled(FQCN, Level.INFO, marker, message, params);
1272    }
1273
1274    @Override
1275    public void info(final Marker marker, final String message, final Throwable t) {
1276        logIfEnabled(FQCN, Level.INFO, marker, message, t);
1277    }
1278
1279    @Override
1280    public void info(final Message msg) {
1281        logIfEnabled(FQCN, Level.INFO, null, msg, msg != null ? msg.getThrowable() : null);
1282    }
1283
1284    @Override
1285    public void info(final Message msg, final Throwable t) {
1286        logIfEnabled(FQCN, Level.INFO, null, msg, t);
1287    }
1288
1289    @Override
1290    public void info(final CharSequence message) {
1291        logIfEnabled(FQCN, Level.INFO, null, message, null);
1292    }
1293
1294    @Override
1295    public void info(final CharSequence message, final Throwable t) {
1296        logIfEnabled(FQCN, Level.INFO, null, message, t);
1297    }
1298
1299    @Override
1300    public void info(final Object message) {
1301        logIfEnabled(FQCN, Level.INFO, null, message, null);
1302    }
1303
1304    @Override
1305    public void info(final Object message, final Throwable t) {
1306        logIfEnabled(FQCN, Level.INFO, null, message, t);
1307    }
1308
1309    @Override
1310    public void info(final String message) {
1311        logIfEnabled(FQCN, Level.INFO, null, message, (Throwable) null);
1312    }
1313
1314    @Override
1315    public void info(final String message, final Object... params) {
1316        logIfEnabled(FQCN, Level.INFO, null, message, params);
1317    }
1318
1319    @Override
1320    public void info(final String message, final Throwable t) {
1321        logIfEnabled(FQCN, Level.INFO, null, message, t);
1322    }
1323
1324    @Override
1325    public void info(final Supplier<?> msgSupplier) {
1326        logIfEnabled(FQCN, Level.INFO, null, msgSupplier, (Throwable) null);
1327    }
1328
1329    @Override
1330    public void info(final Supplier<?> msgSupplier, final Throwable t) {
1331        logIfEnabled(FQCN, Level.INFO, null, msgSupplier, t);
1332    }
1333
1334    @Override
1335    public void info(final Marker marker, final Supplier<?> msgSupplier) {
1336        logIfEnabled(FQCN, Level.INFO, marker, msgSupplier, (Throwable) null);
1337    }
1338
1339    @Override
1340    public void info(final Marker marker, final String message, final Supplier<?>... paramSuppliers) {
1341        logIfEnabled(FQCN, Level.INFO, marker, message, paramSuppliers);
1342    }
1343
1344    @Override
1345    public void info(final Marker marker, final Supplier<?> msgSupplier, final Throwable t) {
1346        logIfEnabled(FQCN, Level.INFO, marker, msgSupplier, t);
1347    }
1348
1349    @Override
1350    public void info(final String message, final Supplier<?>... paramSuppliers) {
1351        logIfEnabled(FQCN, Level.INFO, null, message, paramSuppliers);
1352    }
1353
1354    @Override
1355    public void info(final Marker marker, final MessageSupplier msgSupplier) {
1356        logIfEnabled(FQCN, Level.INFO, marker, msgSupplier, (Throwable) null);
1357    }
1358
1359    @Override
1360    public void info(final Marker marker, final MessageSupplier msgSupplier, final Throwable t) {
1361        logIfEnabled(FQCN, Level.INFO, marker, msgSupplier, t);
1362    }
1363
1364    @Override
1365    public void info(final MessageSupplier msgSupplier) {
1366        logIfEnabled(FQCN, Level.INFO, null, msgSupplier, (Throwable) null);
1367    }
1368
1369    @Override
1370    public void info(final MessageSupplier msgSupplier, final Throwable t) {
1371        logIfEnabled(FQCN, Level.INFO, null, msgSupplier, t);
1372    }
1373
1374    @Override
1375    public void info(final Marker marker, final String message, final Object p0) {
1376        logIfEnabled(FQCN, Level.INFO, marker, message, p0);
1377    }
1378
1379    @Override
1380    public void info(final Marker marker, final String message, final Object p0, final Object p1) {
1381        logIfEnabled(FQCN, Level.INFO, marker, message, p0, p1);
1382    }
1383
1384    @Override
1385    public void info(final Marker marker, final String message, final Object p0, final Object p1, final Object p2) {
1386        logIfEnabled(FQCN, Level.INFO, marker, message, p0, p1, p2);
1387    }
1388
1389    @Override
1390    public void info(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
1391            final Object p3) {
1392        logIfEnabled(FQCN, Level.INFO, marker, message, p0, p1, p2, p3);
1393    }
1394
1395    @Override
1396    public void info(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
1397            final Object p3, final Object p4) {
1398        logIfEnabled(FQCN, Level.INFO, marker, message, p0, p1, p2, p3, p4);
1399    }
1400
1401    @Override
1402    public void info(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
1403            final Object p3, final Object p4, final Object p5) {
1404        logIfEnabled(FQCN, Level.INFO, marker, message, p0, p1, p2, p3, p4, p5);
1405    }
1406
1407    @Override
1408    public void info(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
1409            final Object p3, final Object p4, final Object p5, final Object p6) {
1410        logIfEnabled(FQCN, Level.INFO, marker, message, p0, p1, p2, p3, p4, p5, p6);
1411    }
1412
1413    @Override
1414    public void info(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
1415            final Object p3, final Object p4, final Object p5, final Object p6, final Object p7) {
1416        logIfEnabled(FQCN, Level.INFO, marker, message, p0, p1, p2, p3, p4, p5, p6, p7);
1417    }
1418
1419    @Override
1420    public void info(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
1421            final Object p3, final Object p4, final Object p5,
1422            final Object p6, final Object p7, final Object p8) {
1423        logIfEnabled(FQCN, Level.INFO, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8);
1424    }
1425
1426    @Override
1427    public void info(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
1428            final Object p3, final Object p4, final Object p5,
1429            final Object p6, final Object p7, final Object p8, final Object p9) {
1430        logIfEnabled(FQCN, Level.INFO, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
1431    }
1432
1433    @Override
1434    public void info(final String message, final Object p0) {
1435        logIfEnabled(FQCN, Level.INFO, null, message, p0);
1436    }
1437
1438    @Override
1439    public void info(final String message, final Object p0, final Object p1) {
1440        logIfEnabled(FQCN, Level.INFO, null, message, p0, p1);
1441    }
1442
1443    @Override
1444    public void info(final String message, final Object p0, final Object p1, final Object p2) {
1445        logIfEnabled(FQCN, Level.INFO, null, message, p0, p1, p2);
1446    }
1447
1448    @Override
1449    public void info(final String message, final Object p0, final Object p1, final Object p2, final Object p3) {
1450        logIfEnabled(FQCN, Level.INFO, null, message, p0, p1, p2, p3);
1451    }
1452
1453    @Override
1454    public void info(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1455            final Object p4) {
1456        logIfEnabled(FQCN, Level.INFO, null, message, p0, p1, p2, p3, p4);
1457    }
1458
1459    @Override
1460    public void info(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1461            final Object p4, final Object p5) {
1462        logIfEnabled(FQCN, Level.INFO, null, message, p0, p1, p2, p3, p4, p5);
1463    }
1464
1465    @Override
1466    public void info(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1467            final Object p4, final Object p5, final Object p6) {
1468        logIfEnabled(FQCN, Level.INFO, null, message, p0, p1, p2, p3, p4, p5, p6);
1469    }
1470
1471    @Override
1472    public void info(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1473            final Object p4, final Object p5, final Object p6,
1474            final Object p7) {
1475        logIfEnabled(FQCN, Level.INFO, null, message, p0, p1, p2, p3, p4, p5, p6, p7);
1476    }
1477
1478    @Override
1479    public void info(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1480            final Object p4, final Object p5, final Object p6,
1481            final Object p7, final Object p8) {
1482        logIfEnabled(FQCN, Level.INFO, null, message, p0, p1, p2, p3, p4, p5, p6, p7, p8);
1483    }
1484
1485    @Override
1486    public void info(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1487            final Object p4, final Object p5, final Object p6,
1488            final Object p7, final Object p8, final Object p9) {
1489        logIfEnabled(FQCN, Level.INFO, null, message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
1490    }
1491
1492    @Override
1493    public boolean isDebugEnabled() {
1494        return isEnabled(Level.DEBUG, null, null);
1495    }
1496
1497    @Override
1498    public boolean isDebugEnabled(final Marker marker) {
1499        return isEnabled(Level.DEBUG, marker, (Object) null, null);
1500    }
1501
1502    @Override
1503    public boolean isEnabled(final Level level) {
1504        return isEnabled(level, null, (Object) null, null);
1505    }
1506
1507    @Override
1508    public boolean isEnabled(final Level level, final Marker marker) {
1509        return isEnabled(level, marker, (Object) null, null);
1510    }
1511
1512    @Override
1513    public boolean isErrorEnabled() {
1514        return isEnabled(Level.ERROR, null, (Object) null, null);
1515    }
1516
1517    @Override
1518    public boolean isErrorEnabled(final Marker marker) {
1519        return isEnabled(Level.ERROR, marker, (Object) null, null);
1520    }
1521
1522    @Override
1523    public boolean isFatalEnabled() {
1524        return isEnabled(Level.FATAL, null, (Object) null, null);
1525    }
1526
1527    @Override
1528    public boolean isFatalEnabled(final Marker marker) {
1529        return isEnabled(Level.FATAL, marker, (Object) null, null);
1530    }
1531
1532    @Override
1533    public boolean isInfoEnabled() {
1534        return isEnabled(Level.INFO, null, (Object) null, null);
1535    }
1536
1537    @Override
1538    public boolean isInfoEnabled(final Marker marker) {
1539        return isEnabled(Level.INFO, marker, (Object) null, null);
1540    }
1541
1542    @Override
1543    public boolean isTraceEnabled() {
1544        return isEnabled(Level.TRACE, null, (Object) null, null);
1545    }
1546
1547    @Override
1548    public boolean isTraceEnabled(final Marker marker) {
1549        return isEnabled(Level.TRACE, marker, (Object) null, null);
1550    }
1551
1552    @Override
1553    public boolean isWarnEnabled() {
1554        return isEnabled(Level.WARN, null, (Object) null, null);
1555    }
1556
1557    @Override
1558    public boolean isWarnEnabled(final Marker marker) {
1559        return isEnabled(Level.WARN, marker, (Object) null, null);
1560    }
1561
1562    @Override
1563    public void log(final Level level, final Marker marker, final Message msg) {
1564        logIfEnabled(FQCN, level, marker, msg, msg != null ? msg.getThrowable() : null);
1565    }
1566
1567    @Override
1568    public void log(final Level level, final Marker marker, final Message msg, final Throwable t) {
1569        logIfEnabled(FQCN, level, marker, msg, t);
1570    }
1571
1572    @Override
1573    public void log(final Level level, final Marker marker, final CharSequence message) {
1574        logIfEnabled(FQCN, level, marker, message, (Throwable) null);
1575    }
1576
1577    @Override
1578    public void log(final Level level, final Marker marker, final CharSequence message, final Throwable t) {
1579        if (isEnabled(level, marker, message, t)) {
1580            logMessage(FQCN, level, marker, message, t);
1581        }
1582    }
1583
1584    @Override
1585    public void log(final Level level, final Marker marker, final Object message) {
1586        logIfEnabled(FQCN, level, marker, message, (Throwable) null);
1587    }
1588
1589    @Override
1590    public void log(final Level level, final Marker marker, final Object message, final Throwable t) {
1591        if (isEnabled(level, marker, message, t)) {
1592            logMessage(FQCN, level, marker, message, t);
1593        }
1594    }
1595
1596    @Override
1597    public void log(final Level level, final Marker marker, final String message) {
1598        logIfEnabled(FQCN, level, marker, message, (Throwable) null);
1599    }
1600
1601    @Override
1602    public void log(final Level level, final Marker marker, final String message, final Object... params) {
1603        logIfEnabled(FQCN, level, marker, message, params);
1604    }
1605
1606    @Override
1607    public void log(final Level level, final Marker marker, final String message, final Throwable t) {
1608        logIfEnabled(FQCN, level, marker, message, t);
1609    }
1610
1611    @Override
1612    public void log(final Level level, final Message msg) {
1613        logIfEnabled(FQCN, level, null, msg, msg != null ? msg.getThrowable() : null);
1614    }
1615
1616    @Override
1617    public void log(final Level level, final Message msg, final Throwable t) {
1618        logIfEnabled(FQCN, level, null, msg, t);
1619    }
1620
1621    @Override
1622    public void log(final Level level, final CharSequence message) {
1623        logIfEnabled(FQCN, level, null, message, null);
1624    }
1625
1626    @Override
1627    public void log(final Level level, final CharSequence message, final Throwable t) {
1628        logIfEnabled(FQCN, level, null, message, t);
1629    }
1630
1631    @Override
1632    public void log(final Level level, final Object message) {
1633        logIfEnabled(FQCN, level, null, message, null);
1634    }
1635
1636    @Override
1637    public void log(final Level level, final Object message, final Throwable t) {
1638        logIfEnabled(FQCN, level, null, message, t);
1639    }
1640
1641    @Override
1642    public void log(final Level level, final String message) {
1643        logIfEnabled(FQCN, level, null, message, (Throwable) null);
1644    }
1645
1646    @Override
1647    public void log(final Level level, final String message, final Object... params) {
1648        logIfEnabled(FQCN, level, null, message, params);
1649    }
1650
1651    @Override
1652    public void log(final Level level, final String message, final Throwable t) {
1653        logIfEnabled(FQCN, level, null, message, t);
1654    }
1655
1656    @Override
1657    public void log(final Level level, final Supplier<?> msgSupplier) {
1658        logIfEnabled(FQCN, level, null, msgSupplier, (Throwable) null);
1659    }
1660
1661    @Override
1662    public void log(final Level level, final Supplier<?> msgSupplier, final Throwable t) {
1663        logIfEnabled(FQCN, level, null, msgSupplier, t);
1664    }
1665
1666    @Override
1667    public void log(final Level level, final Marker marker, final Supplier<?> msgSupplier) {
1668        logIfEnabled(FQCN, level, marker, msgSupplier, (Throwable) null);
1669    }
1670
1671    @Override
1672    public void log(final Level level, final Marker marker, final String message, final Supplier<?>... paramSuppliers) {
1673        logIfEnabled(FQCN, level, marker, message, paramSuppliers);
1674    }
1675
1676    @Override
1677    public void log(final Level level, final Marker marker, final Supplier<?> msgSupplier, final Throwable t) {
1678        logIfEnabled(FQCN, level, marker, msgSupplier, t);
1679    }
1680
1681    @Override
1682    public void log(final Level level, final String message, final Supplier<?>... paramSuppliers) {
1683        logIfEnabled(FQCN, level, null, message, paramSuppliers);
1684    }
1685
1686    @Override
1687    public void log(final Level level, final Marker marker, final MessageSupplier msgSupplier) {
1688        logIfEnabled(FQCN, level, marker, msgSupplier, (Throwable) null);
1689    }
1690
1691    @Override
1692    public void log(final Level level, final Marker marker, final MessageSupplier msgSupplier, final Throwable t) {
1693        logIfEnabled(FQCN, level, marker, msgSupplier, t);
1694    }
1695
1696    @Override
1697    public void log(final Level level, final MessageSupplier msgSupplier) {
1698        logIfEnabled(FQCN, level, null, msgSupplier, (Throwable) null);
1699    }
1700
1701    @Override
1702    public void log(final Level level, final MessageSupplier msgSupplier, final Throwable t) {
1703        logIfEnabled(FQCN, level, null, msgSupplier, t);
1704    }
1705
1706    @Override
1707    public void log(final Level level, final Marker marker, final String message, final Object p0) {
1708        logIfEnabled(FQCN, level, marker, message, p0);
1709    }
1710
1711    @Override
1712    public void log(final Level level, final Marker marker, final String message, final Object p0, final Object p1) {
1713        logIfEnabled(FQCN, level, marker, message, p0, p1);
1714    }
1715
1716    @Override
1717    public void log(final Level level, final Marker marker, final String message, final Object p0, final Object p1,
1718            final Object p2) {
1719        logIfEnabled(FQCN, level, marker, message, p0, p1, p2);
1720    }
1721
1722    @Override
1723    public void log(final Level level, final Marker marker, final String message, final Object p0, final Object p1,
1724            final Object p2, final Object p3) {
1725        logIfEnabled(FQCN, level, marker, message, p0, p1, p2, p3);
1726    }
1727
1728    @Override
1729    public void log(final Level level, final Marker marker, final String message, final Object p0, final Object p1,
1730            final Object p2, final Object p3, final Object p4) {
1731        logIfEnabled(FQCN, level, marker, message, p0, p1, p2, p3, p4);
1732    }
1733
1734    @Override
1735    public void log(final Level level, final Marker marker, final String message, final Object p0, final Object p1,
1736            final Object p2, final Object p3, final Object p4, final Object p5) {
1737        logIfEnabled(FQCN, level, marker, message, p0, p1, p2, p3, p4, p5);
1738    }
1739
1740    @Override
1741    public void log(final Level level, final Marker marker, final String message, final Object p0, final Object p1,
1742            final Object p2, final Object p3, final Object p4, final Object p5, final Object p6) {
1743        logIfEnabled(FQCN, level, marker, message, p0, p1, p2, p3, p4, p5, p6);
1744    }
1745
1746    @Override
1747    public void log(final Level level, final Marker marker, final String message, final Object p0, final Object p1,
1748            final Object p2, final Object p3, final Object p4, final Object p5,
1749            final Object p6, final Object p7) {
1750        logIfEnabled(FQCN, level, marker, message, p0, p1, p2, p3, p4, p5, p6, p7);
1751    }
1752
1753    @Override
1754    public void log(final Level level, final Marker marker, final String message, final Object p0, final Object p1,
1755            final Object p2, final Object p3, final Object p4, final Object p5,
1756            final Object p6, final Object p7, final Object p8) {
1757        logIfEnabled(FQCN, level, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8);
1758    }
1759
1760    @Override
1761    public void log(final Level level, final Marker marker, final String message, final Object p0, final Object p1,
1762            final Object p2, final Object p3, final Object p4, final Object p5,
1763            final Object p6, final Object p7, final Object p8, final Object p9) {
1764        logIfEnabled(FQCN, level, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
1765    }
1766
1767    @Override
1768    public void log(final Level level, final String message, final Object p0) {
1769        logIfEnabled(FQCN, level, null, message, p0);
1770    }
1771
1772    @Override
1773    public void log(final Level level, final String message, final Object p0, final Object p1) {
1774        logIfEnabled(FQCN, level, null, message, p0, p1);
1775    }
1776
1777    @Override
1778    public void log(final Level level, final String message, final Object p0, final Object p1, final Object p2) {
1779        logIfEnabled(FQCN, level, null, message, p0, p1, p2);
1780    }
1781
1782    @Override
1783    public void log(final Level level, final String message, final Object p0, final Object p1, final Object p2, final Object p3) {
1784        logIfEnabled(FQCN, level, null, message, p0, p1, p2, p3);
1785    }
1786
1787    @Override
1788    public void log(final Level level, final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1789            final Object p4) {
1790        logIfEnabled(FQCN, level, null, message, p0, p1, p2, p3, p4);
1791    }
1792
1793    @Override
1794    public void log(final Level level, final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1795            final Object p4, final Object p5) {
1796        logIfEnabled(FQCN, level, null, message, p0, p1, p2, p3, p4, p5);
1797    }
1798
1799    @Override
1800    public void log(final Level level, final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1801            final Object p4, final Object p5, final Object p6) {
1802        logIfEnabled(FQCN, level, null, message, p0, p1, p2, p3, p4, p5, p6);
1803    }
1804
1805    @Override
1806    public void log(final Level level, final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1807            final Object p4, final Object p5, final Object p6, final Object p7) {
1808        logIfEnabled(FQCN, level, null, message, p0, p1, p2, p3, p4, p5, p6, p7);
1809    }
1810
1811    @Override
1812    public void log(final Level level, final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1813            final Object p4, final Object p5, final Object p6, final Object p7, final Object p8) {
1814        logIfEnabled(FQCN, level, null, message, p0, p1, p2, p3, p4, p5, p6, p7, p8);
1815    }
1816
1817    @Override
1818    public void log(final Level level, final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1819            final Object p4, final Object p5, final Object p6, final Object p7, final Object p8, final Object p9) {
1820        logIfEnabled(FQCN, level, null, message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
1821    }
1822
1823    @Override
1824    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final Message msg,
1825            final Throwable t) {
1826        if (isEnabled(level, marker, msg, t)) {
1827            logMessageSafely(fqcn, level, marker, msg, t);
1828        }
1829    }
1830
1831    @Override
1832    public void logIfEnabled(final String fqcn, final Level level, final Marker marker,
1833            final MessageSupplier msgSupplier, final Throwable t) {
1834        if (isEnabled(level, marker, msgSupplier, t)) {
1835            logMessage(fqcn, level, marker, msgSupplier, t);
1836        }
1837    }
1838
1839    @Override
1840    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final Object message,
1841            final Throwable t) {
1842        if (isEnabled(level, marker, message, t)) {
1843            logMessage(fqcn, level, marker, message, t);
1844        }
1845    }
1846
1847    @Override
1848    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final CharSequence message,
1849            final Throwable t) {
1850        if (isEnabled(level, marker, message, t)) {
1851            logMessage(fqcn, level, marker, message, t);
1852        }
1853    }
1854
1855    @Override
1856    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final Supplier<?> msgSupplier,
1857            final Throwable t) {
1858        if (isEnabled(level, marker, msgSupplier, t)) {
1859            logMessage(fqcn, level, marker, msgSupplier, t);
1860        }
1861    }
1862
1863    @Override
1864    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final String message) {
1865        if (isEnabled(level, marker, message)) {
1866            logMessage(fqcn, level, marker, message);
1867        }
1868    }
1869
1870    @Override
1871    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final String message,
1872            final Supplier<?>... paramSuppliers) {
1873        if (isEnabled(level, marker, message)) {
1874            logMessage(fqcn, level, marker, message, paramSuppliers);
1875        }
1876    }
1877
1878    @Override
1879    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final String message,
1880            final Object... params) {
1881        if (isEnabled(level, marker, message, params)) {
1882            logMessage(fqcn, level, marker, message, params);
1883        }
1884    }
1885
1886    @Override
1887    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final String message,
1888            final Object p0) {
1889        if (isEnabled(level, marker, message, p0)) {
1890            logMessage(fqcn, level, marker, message, p0);
1891        }
1892    }
1893
1894    @Override
1895    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final String message,
1896            final Object p0, final Object p1) {
1897        if (isEnabled(level, marker, message, p0, p1)) {
1898            logMessage(fqcn, level, marker, message, p0, p1);
1899        }
1900    }
1901
1902    @Override
1903    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final String message,
1904            final Object p0, final Object p1, final Object p2) {
1905        if (isEnabled(level, marker, message, p0, p1, p2)) {
1906            logMessage(fqcn, level, marker, message, p0, p1, p2);
1907        }
1908    }
1909
1910    @Override
1911    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final String message,
1912            final Object p0, final Object p1, final Object p2, final Object p3) {
1913        if (isEnabled(level, marker, message, p0, p1, p2, p3)) {
1914            logMessage(fqcn, level, marker, message, p0, p1, p2, p3);
1915        }
1916    }
1917
1918    @Override
1919    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final String message,
1920            final Object p0, final Object p1, final Object p2, final Object p3, final Object p4) {
1921        if (isEnabled(level, marker, message, p0, p1, p2, p3, p4)) {
1922            logMessage(fqcn, level, marker, message, p0, p1, p2, p3, p4);
1923        }
1924    }
1925
1926    @Override
1927    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final String message,
1928            final Object p0, final Object p1, final Object p2, final Object p3, final Object p4, final Object p5) {
1929        if (isEnabled(level, marker, message, p0, p1, p2, p3, p4, p5)) {
1930            logMessage(fqcn, level, marker, message, p0, p1, p2, p3, p4, p5);
1931        }
1932    }
1933
1934    @Override
1935    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final String message,
1936            final Object p0, final Object p1, final Object p2, final Object p3, final Object p4, final Object p5,
1937            final Object p6) {
1938        if (isEnabled(level, marker, message, p0, p1, p2, p3, p4, p5, p6)) {
1939            logMessage(fqcn, level, marker, message, p0, p1, p2, p3, p4, p5, p6);
1940        }
1941    }
1942
1943    @Override
1944    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final String message,
1945            final Object p0, final Object p1, final Object p2, final Object p3, final Object p4, final Object p5,
1946            final Object p6, final Object p7) {
1947        if (isEnabled(level, marker, message, p0, p1, p2, p3, p4, p5, p6, p7)) {
1948            logMessage(fqcn, level, marker, message, p0, p1, p2, p3, p4, p5, p6, p7);
1949        }
1950    }
1951
1952    @Override
1953    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final String message,
1954            final Object p0, final Object p1, final Object p2, final Object p3, final Object p4, final Object p5,
1955            final Object p6, final Object p7, final Object p8) {
1956        if (isEnabled(level, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8)) {
1957            logMessage(fqcn, level, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8);
1958        }
1959    }
1960
1961    @Override
1962    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final String message,
1963            final Object p0, final Object p1, final Object p2, final Object p3, final Object p4, final Object p5,
1964            final Object p6, final Object p7, final Object p8, final Object p9) {
1965        if (isEnabled(level, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)) {
1966            logMessage(fqcn, level, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
1967        }
1968    }
1969
1970    @Override
1971    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final String message,
1972            final Throwable t) {
1973        if (isEnabled(level, marker, message, t)) {
1974            logMessage(fqcn, level, marker, message, t);
1975        }
1976    }
1977
1978    protected void logMessage(final String fqcn, final Level level, final Marker marker, final CharSequence message,
1979            final Throwable t) {
1980        logMessageSafely(fqcn, level, marker, messageFactory.newMessage(message), t);
1981    }
1982
1983    protected void logMessage(final String fqcn, final Level level, final Marker marker, final Object message,
1984            final Throwable t) {
1985        logMessageSafely(fqcn, level, marker, messageFactory.newMessage(message), t);
1986    }
1987
1988    protected void logMessage(final String fqcn, final Level level, final Marker marker,
1989            final MessageSupplier msgSupplier, final Throwable t) {
1990        final Message message = LambdaUtil.get(msgSupplier);
1991        logMessageSafely(fqcn, level, marker, message, (t == null && message != null) ? message.getThrowable() : t);
1992    }
1993
1994    protected void logMessage(final String fqcn, final Level level, final Marker marker, final Supplier<?> msgSupplier,
1995            final Throwable t) {
1996        final Message message = LambdaUtil.getMessage(msgSupplier, messageFactory);
1997        logMessageSafely(fqcn, level, marker, message, (t == null && message != null) ? message.getThrowable() : t);
1998    }
1999
2000    protected void logMessage(final String fqcn, final Level level, final Marker marker, final String message,
2001            final Throwable t) {
2002        logMessageSafely(fqcn, level, marker, messageFactory.newMessage(message), t);
2003    }
2004
2005    protected void logMessage(final String fqcn, final Level level, final Marker marker, final String message) {
2006        final Message msg = messageFactory.newMessage(message);
2007        logMessageSafely(fqcn, level, marker, msg, msg.getThrowable());
2008    }
2009
2010    protected void logMessage(final String fqcn, final Level level, final Marker marker, final String message,
2011            final Object... params) {
2012        final Message msg = messageFactory.newMessage(message, params);
2013        logMessageSafely(fqcn, level, marker, msg, msg.getThrowable());
2014    }
2015
2016    protected void logMessage(final String fqcn, final Level level, final Marker marker, final String message,
2017            final Object p0) {
2018        final Message msg = messageFactory.newMessage(message, p0);
2019        logMessageSafely(fqcn, level, marker, msg, msg.getThrowable());
2020    }
2021
2022    protected void logMessage(final String fqcn, final Level level, final Marker marker, final String message,
2023            final Object p0, final Object p1) {
2024        final Message msg = messageFactory.newMessage(message, p0, p1);
2025        logMessageSafely(fqcn, level, marker, msg, msg.getThrowable());
2026    }
2027
2028    protected void logMessage(final String fqcn, final Level level, final Marker marker, final String message,
2029            final Object p0, final Object p1, final Object p2) {
2030        final Message msg = messageFactory.newMessage(message, p0, p1, p2);
2031        logMessageSafely(fqcn, level, marker, msg, msg.getThrowable());
2032    }
2033
2034    protected void logMessage(final String fqcn, final Level level, final Marker marker, final String message,
2035            final Object p0, final Object p1, final Object p2, final Object p3) {
2036        final Message msg = messageFactory.newMessage(message, p0, p1, p2, p3);
2037        logMessageSafely(fqcn, level, marker, msg, msg.getThrowable());
2038    }
2039
2040    protected void logMessage(final String fqcn, final Level level, final Marker marker, final String message,
2041            final Object p0, final Object p1, final Object p2, final Object p3, final Object p4) {
2042        final Message msg = messageFactory.newMessage(message, p0, p1, p2, p3, p4);
2043        logMessageSafely(fqcn, level, marker, msg, msg.getThrowable());
2044    }
2045
2046    protected void logMessage(final String fqcn, final Level level, final Marker marker, final String message,
2047            final Object p0, final Object p1, final Object p2, final Object p3, final Object p4, final Object p5) {
2048        final Message msg = messageFactory.newMessage(message, p0, p1, p2, p3, p4, p5);
2049        logMessageSafely(fqcn, level, marker, msg, msg.getThrowable());
2050    }
2051
2052    protected void logMessage(final String fqcn, final Level level, final Marker marker, final String message,
2053            final Object p0, final Object p1, final Object p2, final Object p3, final Object p4, final Object p5,
2054            final Object p6) {
2055        final Message msg = messageFactory.newMessage(message, p0, p1, p2, p3, p4, p5, p6);
2056        logMessageSafely(fqcn, level, marker, msg, msg.getThrowable());
2057    }
2058
2059    protected void logMessage(final String fqcn, final Level level, final Marker marker, final String message,
2060            final Object p0, final Object p1, final Object p2, final Object p3, final Object p4, final Object p5,
2061            final Object p6, final Object p7) {
2062        final Message msg = messageFactory.newMessage(message, p0, p1, p2, p3, p4, p5, p6, p7);
2063        logMessageSafely(fqcn, level, marker, msg, msg.getThrowable());
2064    }
2065
2066    protected void logMessage(final String fqcn, final Level level, final Marker marker, final String message,
2067            final Object p0, final Object p1, final Object p2, final Object p3, final Object p4, final Object p5,
2068            final Object p6, final Object p7, final Object p8) {
2069        final Message msg = messageFactory.newMessage(message, p0, p1, p2, p3, p4, p5, p6, p7, p8);
2070        logMessageSafely(fqcn, level, marker, msg, msg.getThrowable());
2071    }
2072
2073    protected void logMessage(final String fqcn, final Level level, final Marker marker, final String message,
2074            final Object p0, final Object p1, final Object p2, final Object p3, final Object p4, final Object p5,
2075            final Object p6, final Object p7, final Object p8, final Object p9) {
2076        final Message msg = messageFactory.newMessage(message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
2077        logMessageSafely(fqcn, level, marker, msg, msg.getThrowable());
2078    }
2079
2080    protected void logMessage(final String fqcn, final Level level, final Marker marker, final String message,
2081            final Supplier<?>... paramSuppliers) {
2082        final Message msg = messageFactory.newMessage(message, LambdaUtil.getAll(paramSuppliers));
2083        logMessageSafely(fqcn, level, marker, msg, msg.getThrowable());
2084    }
2085
2086    @Override
2087    public void printf(final Level level, final Marker marker, final String format, final Object... params) {
2088        if (isEnabled(level, marker, format, params)) {
2089            final Message msg = new StringFormattedMessage(format, params);
2090            logMessageSafely(FQCN, level, marker, msg, msg.getThrowable());
2091        }
2092    }
2093
2094    @Override
2095    public void printf(final Level level, final String format, final Object... params) {
2096        if (isEnabled(level, null, format, params)) {
2097            final Message msg = new StringFormattedMessage(format, params);
2098            logMessageSafely(FQCN, level, null, msg, msg.getThrowable());
2099        }
2100    }
2101
2102    @PerformanceSensitive
2103    // NOTE: This is a hot method. Current implementation compiles to 30 bytes of byte code.
2104    // This is within the 35 byte MaxInlineSize threshold. Modify with care!
2105    private void logMessageSafely(final String fqcn, final Level level, final Marker marker, final Message msg,
2106            final Throwable throwable) {
2107        try {
2108            logMessageTrackRecursion(fqcn, level, marker, msg, throwable);
2109        } finally {
2110            // LOG4J2-1583 prevent scrambled logs when logging calls are nested (logging in toString())
2111            ReusableMessageFactory.release(msg);
2112        }
2113    }
2114
2115    @PerformanceSensitive
2116    // NOTE: This is a hot method. Current implementation compiles to 29 bytes of byte code.
2117    // This is within the 35 byte MaxInlineSize threshold. Modify with care!
2118    private void logMessageTrackRecursion(final String fqcn,
2119                                          final Level level,
2120                                          final Marker marker,
2121                                          final Message msg,
2122                                          final Throwable throwable) {
2123        try {
2124            incrementRecursionDepth(); // LOG4J2-1518, LOG4J2-2031
2125            tryLogMessage(fqcn, level, marker, msg, throwable);
2126        } finally {
2127            decrementRecursionDepth();
2128        }
2129    }
2130
2131    private static int[] getRecursionDepthHolder() {
2132        int[] result = recursionDepthHolder.get();
2133        if (result == null) {
2134            result = new int[1];
2135            recursionDepthHolder.set(result);
2136        }
2137        return result;
2138    }
2139
2140    private static void incrementRecursionDepth() {
2141        getRecursionDepthHolder()[0]++;
2142    }
2143    private static void decrementRecursionDepth() {
2144        int[] depth = getRecursionDepthHolder();
2145        depth[0]--;
2146        if (depth[0] < 0) {
2147            throw new IllegalStateException("Recursion depth became negative: " + depth[0]);
2148        }
2149    }
2150
2151    /**
2152     * Returns the depth of nested logging calls in the current Thread: zero if no logging call has been made,
2153     * one if a single logging call without nested logging calls has been made, or more depending on the level of
2154     * nesting.
2155     * @return the depth of the nested logging calls in the current Thread
2156     */
2157    public static int getRecursionDepth() {
2158        return getRecursionDepthHolder()[0];
2159    }
2160
2161    @PerformanceSensitive
2162    // NOTE: This is a hot method. Current implementation compiles to 26 bytes of byte code.
2163    // This is within the 35 byte MaxInlineSize threshold. Modify with care!
2164    private void tryLogMessage(final String fqcn,
2165                               final Level level,
2166                               final Marker marker,
2167                               final Message msg,
2168                               final Throwable throwable) {
2169        try {
2170            logMessage(fqcn, level, marker, msg, throwable);
2171        } catch (final Exception e) {
2172            // LOG4J2-1990 Log4j2 suppresses all exceptions that occur once application called the logger
2173            handleLogMessageException(e, fqcn, msg);
2174        }
2175    }
2176
2177    // LOG4J2-1990 Log4j2 suppresses all exceptions that occur once application called the logger
2178    // TODO Configuration setting to propagate exceptions back to the caller *if requested*
2179    private void handleLogMessageException(final Exception exception, final String fqcn, final Message msg) {
2180        if (exception instanceof LoggingException) {
2181            throw (LoggingException) exception;
2182        }
2183        final String format = msg.getFormat();
2184        final int formatLength = format == null ? 4 : format.length();
2185        final StringBuilder sb = new StringBuilder(formatLength + 100);
2186        sb.append(fqcn);
2187        sb.append(" caught ");
2188        sb.append(exception.getClass().getName());
2189        sb.append(" logging ");
2190        sb.append(msg.getClass().getSimpleName());
2191        sb.append(": ");
2192        sb.append(format);
2193        StatusLogger.getLogger().warn(sb.toString(), exception);
2194    }
2195
2196    @Override
2197    public <T extends Throwable> T throwing(final T t) {
2198        return throwing(FQCN, Level.ERROR, t);
2199    }
2200
2201    @Override
2202    public <T extends Throwable> T throwing(final Level level, final T t) {
2203        return throwing(FQCN, level, t);
2204    }
2205
2206    /**
2207     * Logs a Throwable to be thrown.
2208     *
2209     * @param <T> the type of the Throwable.
2210     * @param fqcn the fully qualified class name of this Logger implementation.
2211     * @param level The logging Level.
2212     * @param t The Throwable.
2213     * @return the Throwable.
2214     */
2215    protected <T extends Throwable> T throwing(final String fqcn, final Level level, final T t) {
2216        if (isEnabled(level, THROWING_MARKER, (Object) null, null)) {
2217            logMessageSafely(fqcn, level, THROWING_MARKER, throwingMsg(t), t);
2218        }
2219        return t;
2220    }
2221
2222    protected Message throwingMsg(final Throwable t) {
2223        return messageFactory.newMessage(THROWING);
2224    }
2225
2226    @Override
2227    public void trace(final Marker marker, final Message msg) {
2228        logIfEnabled(FQCN, Level.TRACE, marker, msg, msg != null ? msg.getThrowable() : null);
2229    }
2230
2231    @Override
2232    public void trace(final Marker marker, final Message msg, final Throwable t) {
2233        logIfEnabled(FQCN, Level.TRACE, marker, msg, t);
2234    }
2235
2236    @Override
2237    public void trace(final Marker marker, final CharSequence message) {
2238        logIfEnabled(FQCN, Level.TRACE, marker, message, null);
2239    }
2240
2241    @Override
2242    public void trace(final Marker marker, final CharSequence message, final Throwable t) {
2243        logIfEnabled(FQCN, Level.TRACE, marker, message, t);
2244    }
2245
2246    @Override
2247    public void trace(final Marker marker, final Object message) {
2248        logIfEnabled(FQCN, Level.TRACE, marker, message, null);
2249    }
2250
2251    @Override
2252    public void trace(final Marker marker, final Object message, final Throwable t) {
2253        logIfEnabled(FQCN, Level.TRACE, marker, message, t);
2254    }
2255
2256    @Override
2257    public void trace(final Marker marker, final String message) {
2258        logIfEnabled(FQCN, Level.TRACE, marker, message, (Throwable) null);
2259    }
2260
2261    @Override
2262    public void trace(final Marker marker, final String message, final Object... params) {
2263        logIfEnabled(FQCN, Level.TRACE, marker, message, params);
2264    }
2265
2266    @Override
2267    public void trace(final Marker marker, final String message, final Throwable t) {
2268        logIfEnabled(FQCN, Level.TRACE, marker, message, t);
2269    }
2270
2271    @Override
2272    public void trace(final Message msg) {
2273        logIfEnabled(FQCN, Level.TRACE, null, msg, msg != null ? msg.getThrowable() : null);
2274    }
2275
2276    @Override
2277    public void trace(final Message msg, final Throwable t) {
2278        logIfEnabled(FQCN, Level.TRACE, null, msg, t);
2279    }
2280
2281    @Override
2282    public void trace(final CharSequence message) {
2283        logIfEnabled(FQCN, Level.TRACE, null, message, null);
2284    }
2285
2286    @Override
2287    public void trace(final CharSequence message, final Throwable t) {
2288        logIfEnabled(FQCN, Level.TRACE, null, message, t);
2289    }
2290
2291    @Override
2292    public void trace(final Object message) {
2293        logIfEnabled(FQCN, Level.TRACE, null, message, null);
2294    }
2295
2296    @Override
2297    public void trace(final Object message, final Throwable t) {
2298        logIfEnabled(FQCN, Level.TRACE, null, message, t);
2299    }
2300
2301    @Override
2302    public void trace(final String message) {
2303        logIfEnabled(FQCN, Level.TRACE, null, message, (Throwable) null);
2304    }
2305
2306    @Override
2307    public void trace(final String message, final Object... params) {
2308        logIfEnabled(FQCN, Level.TRACE, null, message, params);
2309    }
2310
2311    @Override
2312    public void trace(final String message, final Throwable t) {
2313        logIfEnabled(FQCN, Level.TRACE, null, message, t);
2314    }
2315
2316    @Override
2317    public void trace(final Supplier<?> msgSupplier) {
2318        logIfEnabled(FQCN, Level.TRACE, null, msgSupplier, (Throwable) null);
2319    }
2320
2321    @Override
2322    public void trace(final Supplier<?> msgSupplier, final Throwable t) {
2323        logIfEnabled(FQCN, Level.TRACE, null, msgSupplier, t);
2324    }
2325
2326    @Override
2327    public void trace(final Marker marker, final Supplier<?> msgSupplier) {
2328        logIfEnabled(FQCN, Level.TRACE, marker, msgSupplier, (Throwable) null);
2329    }
2330
2331    @Override
2332    public void trace(final Marker marker, final String message, final Supplier<?>... paramSuppliers) {
2333        logIfEnabled(FQCN, Level.TRACE, marker, message, paramSuppliers);
2334    }
2335
2336    @Override
2337    public void trace(final Marker marker, final Supplier<?> msgSupplier, final Throwable t) {
2338        logIfEnabled(FQCN, Level.TRACE, marker, msgSupplier, t);
2339    }
2340
2341    @Override
2342    public void trace(final String message, final Supplier<?>... paramSuppliers) {
2343        logIfEnabled(FQCN, Level.TRACE, null, message, paramSuppliers);
2344    }
2345
2346    @Override
2347    public void trace(final Marker marker, final MessageSupplier msgSupplier) {
2348        logIfEnabled(FQCN, Level.TRACE, marker, msgSupplier, (Throwable) null);
2349    }
2350
2351    @Override
2352    public void trace(final Marker marker, final MessageSupplier msgSupplier, final Throwable t) {
2353        logIfEnabled(FQCN, Level.TRACE, marker, msgSupplier, t);
2354    }
2355
2356    @Override
2357    public void trace(final MessageSupplier msgSupplier) {
2358        logIfEnabled(FQCN, Level.TRACE, null, msgSupplier, (Throwable) null);
2359    }
2360
2361    @Override
2362    public void trace(final MessageSupplier msgSupplier, final Throwable t) {
2363        logIfEnabled(FQCN, Level.TRACE, null, msgSupplier, t);
2364    }
2365
2366    @Override
2367    public void trace(final Marker marker, final String message, final Object p0) {
2368        logIfEnabled(FQCN, Level.TRACE, marker, message, p0);
2369    }
2370
2371    @Override
2372    public void trace(final Marker marker, final String message, final Object p0, final Object p1) {
2373        logIfEnabled(FQCN, Level.TRACE, marker, message, p0, p1);
2374    }
2375
2376    @Override
2377    public void trace(final Marker marker, final String message, final Object p0, final Object p1, final Object p2) {
2378        logIfEnabled(FQCN, Level.TRACE, marker, message, p0, p1, p2);
2379    }
2380
2381    @Override
2382    public void trace(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
2383            final Object p3) {
2384        logIfEnabled(FQCN, Level.TRACE, marker, message, p0, p1, p2, p3);
2385    }
2386
2387    @Override
2388    public void trace(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
2389            final Object p3, final Object p4) {
2390        logIfEnabled(FQCN, Level.TRACE, marker, message, p0, p1, p2, p3, p4);
2391    }
2392
2393    @Override
2394    public void trace(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
2395            final Object p3, final Object p4, final Object p5) {
2396        logIfEnabled(FQCN, Level.TRACE, marker, message, p0, p1, p2, p3, p4, p5);
2397    }
2398
2399    @Override
2400    public void trace(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
2401            final Object p3, final Object p4, final Object p5, final Object p6) {
2402        logIfEnabled(FQCN, Level.TRACE, marker, message, p0, p1, p2, p3, p4, p5, p6);
2403    }
2404
2405    @Override
2406    public void trace(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
2407            final Object p3, final Object p4, final Object p5, final Object p6, final Object p7) {
2408        logIfEnabled(FQCN, Level.TRACE, marker, message, p0, p1, p2, p3, p4, p5, p6, p7);
2409    }
2410
2411    @Override
2412    public void trace(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
2413            final Object p3, final Object p4, final Object p5,
2414            final Object p6, final Object p7, final Object p8) {
2415        logIfEnabled(FQCN, Level.TRACE, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8);
2416    }
2417
2418    @Override
2419    public void trace(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
2420            final Object p3, final Object p4, final Object p5,
2421            final Object p6, final Object p7, final Object p8, final Object p9) {
2422        logIfEnabled(FQCN, Level.TRACE, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
2423    }
2424
2425    @Override
2426    public void trace(final String message, final Object p0) {
2427        logIfEnabled(FQCN, Level.TRACE, null, message, p0);
2428    }
2429
2430    @Override
2431    public void trace(final String message, final Object p0, final Object p1) {
2432        logIfEnabled(FQCN, Level.TRACE, null, message, p0, p1);
2433    }
2434
2435    @Override
2436    public void trace(final String message, final Object p0, final Object p1, final Object p2) {
2437        logIfEnabled(FQCN, Level.TRACE, null, message, p0, p1, p2);
2438    }
2439
2440    @Override
2441    public void trace(final String message, final Object p0, final Object p1, final Object p2, final Object p3) {
2442        logIfEnabled(FQCN, Level.TRACE, null, message, p0, p1, p2, p3);
2443    }
2444
2445    @Override
2446    public void trace(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
2447            final Object p4) {
2448        logIfEnabled(FQCN, Level.TRACE, null, message, p0, p1, p2, p3, p4);
2449    }
2450
2451    @Override
2452    public void trace(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
2453            final Object p4, final Object p5) {
2454        logIfEnabled(FQCN, Level.TRACE, null, message, p0, p1, p2, p3, p4, p5);
2455    }
2456
2457    @Override
2458    public void trace(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
2459            final Object p4, final Object p5, final Object p6) {
2460        logIfEnabled(FQCN, Level.TRACE, null, message, p0, p1, p2, p3, p4, p5, p6);
2461    }
2462
2463    @Override
2464    public void trace(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
2465            final Object p4, final Object p5, final Object p6, final Object p7) {
2466        logIfEnabled(FQCN, Level.TRACE, null, message, p0, p1, p2, p3, p4, p5, p6, p7);
2467    }
2468
2469    @Override
2470    public void trace(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
2471            final Object p4, final Object p5, final Object p6, final Object p7, final Object p8) {
2472        logIfEnabled(FQCN, Level.TRACE, null, message, p0, p1, p2, p3, p4, p5, p6, p7, p8);
2473    }
2474
2475    @Override
2476    public void trace(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
2477            final Object p4, final Object p5, final Object p6, final Object p7, final Object p8, final Object p9) {
2478        logIfEnabled(FQCN, Level.TRACE, null, message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
2479    }
2480
2481    @Override
2482    public EntryMessage traceEntry() {
2483        return enter(FQCN, null, (Object[]) null);
2484    }
2485
2486    @Override
2487    public EntryMessage traceEntry(final String format, final Object... params) {
2488        return enter(FQCN, format, params);
2489    }
2490
2491    @Override
2492    public EntryMessage traceEntry(final Supplier<?>... paramSuppliers) {
2493        return enter(FQCN, null, paramSuppliers);
2494    }
2495
2496    @Override
2497    public EntryMessage traceEntry(final String format, final Supplier<?>... paramSuppliers) {
2498        return enter(FQCN, format, paramSuppliers);
2499    }
2500
2501    @Override
2502    public EntryMessage traceEntry(final Message message) {
2503        return enter(FQCN, message);
2504    }
2505
2506    @Override
2507    public void traceExit() {
2508        exit(FQCN, null, null);
2509    }
2510
2511    @Override
2512    public <R> R traceExit(final R result) {
2513        return exit(FQCN, null, result);
2514    }
2515
2516    @Override
2517    public <R> R traceExit(final String format, final R result) {
2518        return exit(FQCN, format, result);
2519    }
2520
2521    @Override
2522    public void traceExit(final EntryMessage message) {
2523        // If the message is null, traceEnter returned null because flow logging was disabled, we can optimize out calling isEnabled().
2524        if (message != null && isEnabled(Level.TRACE, EXIT_MARKER, message, null)) {
2525            logMessageSafely(FQCN, Level.TRACE, EXIT_MARKER, flowMessageFactory.newExitMessage(message), null);
2526        }
2527    }
2528
2529    @Override
2530    public <R> R traceExit(final EntryMessage message, final R result) {
2531        // If the message is null, traceEnter returned null because flow logging was disabled, we can optimize out calling isEnabled().
2532        if (message != null && isEnabled(Level.TRACE, EXIT_MARKER, message, null)) {
2533            logMessageSafely(FQCN, Level.TRACE, EXIT_MARKER, flowMessageFactory.newExitMessage(result, message), null);
2534        }
2535        return result;
2536    }
2537
2538    @Override
2539    public <R> R traceExit(final Message message, final R result) {
2540        // If the message is null, traceEnter returned null because flow logging was disabled, we can optimize out calling isEnabled().
2541        if (message != null && isEnabled(Level.TRACE, EXIT_MARKER, message, null)) {
2542            logMessageSafely(FQCN, Level.TRACE, EXIT_MARKER, flowMessageFactory.newExitMessage(result, message), null);
2543        }
2544        return result;
2545    }
2546
2547    @Override
2548    public void warn(final Marker marker, final Message msg) {
2549        logIfEnabled(FQCN, Level.WARN, marker, msg, msg != null ? msg.getThrowable() : null);
2550    }
2551
2552    @Override
2553    public void warn(final Marker marker, final Message msg, final Throwable t) {
2554        logIfEnabled(FQCN, Level.WARN, marker, msg, t);
2555    }
2556
2557    @Override
2558    public void warn(final Marker marker, final CharSequence message) {
2559        logIfEnabled(FQCN, Level.WARN, marker, message, null);
2560    }
2561
2562    @Override
2563    public void warn(final Marker marker, final CharSequence message, final Throwable t) {
2564        logIfEnabled(FQCN, Level.WARN, marker, message, t);
2565    }
2566
2567    @Override
2568    public void warn(final Marker marker, final Object message) {
2569        logIfEnabled(FQCN, Level.WARN, marker, message, null);
2570    }
2571
2572    @Override
2573    public void warn(final Marker marker, final Object message, final Throwable t) {
2574        logIfEnabled(FQCN, Level.WARN, marker, message, t);
2575    }
2576
2577    @Override
2578    public void warn(final Marker marker, final String message) {
2579        logIfEnabled(FQCN, Level.WARN, marker, message, (Throwable) null);
2580    }
2581
2582    @Override
2583    public void warn(final Marker marker, final String message, final Object... params) {
2584        logIfEnabled(FQCN, Level.WARN, marker, message, params);
2585    }
2586
2587    @Override
2588    public void warn(final Marker marker, final String message, final Throwable t) {
2589        logIfEnabled(FQCN, Level.WARN, marker, message, t);
2590    }
2591
2592    @Override
2593    public void warn(final Message msg) {
2594        logIfEnabled(FQCN, Level.WARN, null, msg, msg != null ? msg.getThrowable() : null);
2595    }
2596
2597    @Override
2598    public void warn(final Message msg, final Throwable t) {
2599        logIfEnabled(FQCN, Level.WARN, null, msg, t);
2600    }
2601
2602    @Override
2603    public void warn(final CharSequence message) {
2604        logIfEnabled(FQCN, Level.WARN, null, message, null);
2605    }
2606
2607    @Override
2608    public void warn(final CharSequence message, final Throwable t) {
2609        logIfEnabled(FQCN, Level.WARN, null, message, t);
2610    }
2611
2612    @Override
2613    public void warn(final Object message) {
2614        logIfEnabled(FQCN, Level.WARN, null, message, null);
2615    }
2616
2617    @Override
2618    public void warn(final Object message, final Throwable t) {
2619        logIfEnabled(FQCN, Level.WARN, null, message, t);
2620    }
2621
2622    @Override
2623    public void warn(final String message) {
2624        logIfEnabled(FQCN, Level.WARN, null, message, (Throwable) null);
2625    }
2626
2627    @Override
2628    public void warn(final String message, final Object... params) {
2629        logIfEnabled(FQCN, Level.WARN, null, message, params);
2630    }
2631
2632    @Override
2633    public void warn(final String message, final Throwable t) {
2634        logIfEnabled(FQCN, Level.WARN, null, message, t);
2635    }
2636
2637    @Override
2638    public void warn(final Supplier<?> msgSupplier) {
2639        logIfEnabled(FQCN, Level.WARN, null, msgSupplier, (Throwable) null);
2640    }
2641
2642    @Override
2643    public void warn(final Supplier<?> msgSupplier, final Throwable t) {
2644        logIfEnabled(FQCN, Level.WARN, null, msgSupplier, t);
2645    }
2646
2647    @Override
2648    public void warn(final Marker marker, final Supplier<?> msgSupplier) {
2649        logIfEnabled(FQCN, Level.WARN, marker, msgSupplier, (Throwable) null);
2650    }
2651
2652    @Override
2653    public void warn(final Marker marker, final String message, final Supplier<?>... paramSuppliers) {
2654        logIfEnabled(FQCN, Level.WARN, marker, message, paramSuppliers);
2655    }
2656
2657    @Override
2658    public void warn(final Marker marker, final Supplier<?> msgSupplier, final Throwable t) {
2659        logIfEnabled(FQCN, Level.WARN, marker, msgSupplier, t);
2660    }
2661
2662    @Override
2663    public void warn(final String message, final Supplier<?>... paramSuppliers) {
2664        logIfEnabled(FQCN, Level.WARN, null, message, paramSuppliers);
2665    }
2666
2667    @Override
2668    public void warn(final Marker marker, final MessageSupplier msgSupplier) {
2669        logIfEnabled(FQCN, Level.WARN, marker, msgSupplier, (Throwable) null);
2670    }
2671
2672    @Override
2673    public void warn(final Marker marker, final MessageSupplier msgSupplier, final Throwable t) {
2674        logIfEnabled(FQCN, Level.WARN, marker, msgSupplier, t);
2675    }
2676
2677    @Override
2678    public void warn(final MessageSupplier msgSupplier) {
2679        logIfEnabled(FQCN, Level.WARN, null, msgSupplier, (Throwable) null);
2680    }
2681
2682    @Override
2683    public void warn(final MessageSupplier msgSupplier, final Throwable t) {
2684        logIfEnabled(FQCN, Level.WARN, null, msgSupplier, t);
2685    }
2686
2687    @Override
2688    public void warn(final Marker marker, final String message, final Object p0) {
2689        logIfEnabled(FQCN, Level.WARN, marker, message, p0);
2690    }
2691
2692    @Override
2693    public void warn(final Marker marker, final String message, final Object p0, final Object p1) {
2694        logIfEnabled(FQCN, Level.WARN, marker, message, p0, p1);
2695    }
2696
2697    @Override
2698    public void warn(final Marker marker, final String message, final Object p0, final Object p1, final Object p2) {
2699        logIfEnabled(FQCN, Level.WARN, marker, message, p0, p1, p2);
2700    }
2701
2702    @Override
2703    public void warn(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
2704            final Object p3) {
2705        logIfEnabled(FQCN, Level.WARN, marker, message, p0, p1, p2, p3);
2706    }
2707
2708    @Override
2709    public void warn(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
2710            final Object p3, final Object p4) {
2711        logIfEnabled(FQCN, Level.WARN, marker, message, p0, p1, p2, p3, p4);
2712    }
2713
2714    @Override
2715    public void warn(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
2716            final Object p3, final Object p4, final Object p5) {
2717        logIfEnabled(FQCN, Level.WARN, marker, message, p0, p1, p2, p3, p4, p5);
2718    }
2719
2720    @Override
2721    public void warn(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
2722            final Object p3, final Object p4, final Object p5, final Object p6) {
2723        logIfEnabled(FQCN, Level.WARN, marker, message, p0, p1, p2, p3, p4, p5, p6);
2724    }
2725
2726    @Override
2727    public void warn(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
2728            final Object p3, final Object p4, final Object p5, final Object p6, final Object p7) {
2729        logIfEnabled(FQCN, Level.WARN, marker, message, p0, p1, p2, p3, p4, p5, p6, p7);
2730    }
2731
2732    @Override
2733    public void warn(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
2734            final Object p3, final Object p4, final Object p5, final Object p6, final Object p7, final Object p8) {
2735        logIfEnabled(FQCN, Level.WARN, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8);
2736    }
2737
2738    @Override
2739    public void warn(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
2740            final Object p3, final Object p4, final Object p5,
2741            final Object p6, final Object p7, final Object p8, final Object p9) {
2742        logIfEnabled(FQCN, Level.WARN, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
2743    }
2744
2745    @Override
2746    public void warn(final String message, final Object p0) {
2747        logIfEnabled(FQCN, Level.WARN, null, message, p0);
2748    }
2749
2750    @Override
2751    public void warn(final String message, final Object p0, final Object p1) {
2752        logIfEnabled(FQCN, Level.WARN, null, message, p0, p1);
2753    }
2754
2755    @Override
2756    public void warn(final String message, final Object p0, final Object p1, final Object p2) {
2757        logIfEnabled(FQCN, Level.WARN, null, message, p0, p1, p2);
2758    }
2759
2760    @Override
2761    public void warn(final String message, final Object p0, final Object p1, final Object p2, final Object p3) {
2762        logIfEnabled(FQCN, Level.WARN, null, message, p0, p1, p2, p3);
2763    }
2764
2765    @Override
2766    public void warn(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
2767            final Object p4) {
2768        logIfEnabled(FQCN, Level.WARN, null, message, p0, p1, p2, p3, p4);
2769    }
2770
2771    @Override
2772    public void warn(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
2773            final Object p4, final Object p5) {
2774        logIfEnabled(FQCN, Level.WARN, null, message, p0, p1, p2, p3, p4, p5);
2775    }
2776
2777    @Override
2778    public void warn(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
2779            final Object p4, final Object p5, final Object p6) {
2780        logIfEnabled(FQCN, Level.WARN, null, message, p0, p1, p2, p3, p4, p5, p6);
2781    }
2782
2783    @Override
2784    public void warn(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
2785            final Object p4, final Object p5, final Object p6, final Object p7) {
2786        logIfEnabled(FQCN, Level.WARN, null, message, p0, p1, p2, p3, p4, p5, p6, p7);
2787    }
2788
2789    @Override
2790    public void warn(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
2791            final Object p4, final Object p5, final Object p6, final Object p7, final Object p8) {
2792        logIfEnabled(FQCN, Level.WARN, null, message, p0, p1, p2, p3, p4, p5, p6, p7, p8);
2793    }
2794
2795    @Override
2796    public void warn(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
2797            final Object p4, final Object p5, final Object p6,
2798            final Object p7, final Object p8, final Object p9) {
2799        logIfEnabled(FQCN, Level.WARN, null, message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
2800    }
2801}