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    @Override
582    public void entry() {
583        entry(FQCN, (Object[]) null);
584    }
585
586    @Override
587    public void entry(final Object... params) {
588        entry(FQCN, params);
589    }
590
591    /**
592     * Logs entry to a method with location information.
593     *
594     * @param fqcn The fully qualified class name of the <b>caller</b>.
595     * @param params The parameters to the method.
596     */
597    protected void entry(final String fqcn, final Object... params) {
598        if (isEnabled(Level.TRACE, ENTRY_MARKER, (Object) null, null)) {
599            if (params == null) {
600                logMessageSafely(fqcn, Level.TRACE, ENTRY_MARKER, entryMsg(null, (Supplier<?>[]) null), null);
601            } else {
602                logMessageSafely(fqcn, Level.TRACE, ENTRY_MARKER, entryMsg(null, params), null);
603            }
604        }
605    }
606
607    protected EntryMessage entryMsg(final String format, final Object... params) {
608        final int count = params == null ? 0 : params.length;
609        if (count == 0) {
610            if (Strings.isEmpty(format)) {
611                return flowMessageFactory.newEntryMessage(null);
612            }
613            return flowMessageFactory.newEntryMessage(new SimpleMessage(format));
614        }
615        if (format != null) {
616            return flowMessageFactory.newEntryMessage(new ParameterizedMessage(format, params));
617        }
618        final StringBuilder sb = new StringBuilder();
619        sb.append("params(");
620        for (int i = 0; i < count; i++) {
621            if (i > 0) {
622                sb.append(", ");
623            }
624            final Object parm = params[i];
625            sb.append(parm instanceof Message ? ((Message) parm).getFormattedMessage() : String.valueOf(parm));
626        }
627        sb.append(')');
628        return flowMessageFactory.newEntryMessage(new SimpleMessage(sb));
629    }
630
631    protected EntryMessage entryMsg(final String format, final MessageSupplier... paramSuppliers) {
632        final int count = paramSuppliers == null ? 0 : paramSuppliers.length;
633        final Object[] params = new Object[count];
634        for (int i = 0; i < count; i++) {
635            params[i] = paramSuppliers[i].get();
636            params[i] = params[i] != null ? ((Message) params[i]).getFormattedMessage() : null;
637        }
638        return entryMsg(format, params);
639    }
640
641    protected EntryMessage entryMsg(final String format, final Supplier<?>... paramSuppliers) {
642        final int count = paramSuppliers == null ? 0 : paramSuppliers.length;
643        final Object[] params = new Object[count];
644        for (int i = 0; i < count; i++) {
645            params[i] = paramSuppliers[i].get();
646            if (params[i] instanceof Message) {
647                params[i] = ((Message) params[i]).getFormattedMessage();
648            }
649        }
650        return entryMsg(format, params);
651    }
652
653    @Override
654    public void error(final Marker marker, final Message msg) {
655        logIfEnabled(FQCN, Level.ERROR, marker, msg, msg != null ? msg.getThrowable() : null);
656    }
657
658    @Override
659    public void error(final Marker marker, final Message msg, final Throwable t) {
660        logIfEnabled(FQCN, Level.ERROR, marker, msg, t);
661    }
662
663    @Override
664    public void error(final Marker marker, final CharSequence message) {
665        logIfEnabled(FQCN, Level.ERROR, marker, message, null);
666    }
667
668    @Override
669    public void error(final Marker marker, final CharSequence message, final Throwable t) {
670        logIfEnabled(FQCN, Level.ERROR, marker, message, t);
671    }
672
673    @Override
674    public void error(final Marker marker, final Object message) {
675        logIfEnabled(FQCN, Level.ERROR, marker, message, null);
676    }
677
678    @Override
679    public void error(final Marker marker, final Object message, final Throwable t) {
680        logIfEnabled(FQCN, Level.ERROR, marker, message, t);
681    }
682
683    @Override
684    public void error(final Marker marker, final String message) {
685        logIfEnabled(FQCN, Level.ERROR, marker, message, (Throwable) null);
686    }
687
688    @Override
689    public void error(final Marker marker, final String message, final Object... params) {
690        logIfEnabled(FQCN, Level.ERROR, marker, message, params);
691    }
692
693    @Override
694    public void error(final Marker marker, final String message, final Throwable t) {
695        logIfEnabled(FQCN, Level.ERROR, marker, message, t);
696    }
697
698    @Override
699    public void error(final Message msg) {
700        logIfEnabled(FQCN, Level.ERROR, null, msg, msg != null ? msg.getThrowable() : null);
701    }
702
703    @Override
704    public void error(final Message msg, final Throwable t) {
705        logIfEnabled(FQCN, Level.ERROR, null, msg, t);
706    }
707
708    @Override
709    public void error(final CharSequence message) {
710        logIfEnabled(FQCN, Level.ERROR, null, message, null);
711    }
712
713    @Override
714    public void error(final CharSequence message, final Throwable t) {
715        logIfEnabled(FQCN, Level.ERROR, null, message, t);
716    }
717
718    @Override
719    public void error(final Object message) {
720        logIfEnabled(FQCN, Level.ERROR, null, message, null);
721    }
722
723    @Override
724    public void error(final Object message, final Throwable t) {
725        logIfEnabled(FQCN, Level.ERROR, null, message, t);
726    }
727
728    @Override
729    public void error(final String message) {
730        logIfEnabled(FQCN, Level.ERROR, null, message, (Throwable) null);
731    }
732
733    @Override
734    public void error(final String message, final Object... params) {
735        logIfEnabled(FQCN, Level.ERROR, null, message, params);
736    }
737
738    @Override
739    public void error(final String message, final Throwable t) {
740        logIfEnabled(FQCN, Level.ERROR, null, message, t);
741    }
742
743    @Override
744    public void error(final Supplier<?> msgSupplier) {
745        logIfEnabled(FQCN, Level.ERROR, null, msgSupplier, (Throwable) null);
746    }
747
748    @Override
749    public void error(final Supplier<?> msgSupplier, final Throwable t) {
750        logIfEnabled(FQCN, Level.ERROR, null, msgSupplier, t);
751    }
752
753    @Override
754    public void error(final Marker marker, final Supplier<?> msgSupplier) {
755        logIfEnabled(FQCN, Level.ERROR, marker, msgSupplier, (Throwable) null);
756    }
757
758    @Override
759    public void error(final Marker marker, final String message, final Supplier<?>... paramSuppliers) {
760        logIfEnabled(FQCN, Level.ERROR, marker, message, paramSuppliers);
761    }
762
763    @Override
764    public void error(final Marker marker, final Supplier<?> msgSupplier, final Throwable t) {
765        logIfEnabled(FQCN, Level.ERROR, marker, msgSupplier, t);
766    }
767
768    @Override
769    public void error(final String message, final Supplier<?>... paramSuppliers) {
770        logIfEnabled(FQCN, Level.ERROR, null, message, paramSuppliers);
771    }
772
773    @Override
774    public void error(final Marker marker, final MessageSupplier msgSupplier) {
775        logIfEnabled(FQCN, Level.ERROR, marker, msgSupplier, (Throwable) null);
776    }
777
778    @Override
779    public void error(final Marker marker, final MessageSupplier msgSupplier, final Throwable t) {
780        logIfEnabled(FQCN, Level.ERROR, marker, msgSupplier, t);
781    }
782
783    @Override
784    public void error(final MessageSupplier msgSupplier) {
785        logIfEnabled(FQCN, Level.ERROR, null, msgSupplier, (Throwable) null);
786    }
787
788    @Override
789    public void error(final MessageSupplier msgSupplier, final Throwable t) {
790        logIfEnabled(FQCN, Level.ERROR, null, msgSupplier, t);
791    }
792
793    @Override
794    public void error(final Marker marker, final String message, final Object p0) {
795        logIfEnabled(FQCN, Level.ERROR, marker, message, p0);
796    }
797
798    @Override
799    public void error(final Marker marker, final String message, final Object p0, final Object p1) {
800        logIfEnabled(FQCN, Level.ERROR, marker, message, p0, p1);
801    }
802
803    @Override
804    public void error(final Marker marker, final String message, final Object p0, final Object p1, final Object p2) {
805        logIfEnabled(FQCN, Level.ERROR, marker, message, p0, p1, p2);
806    }
807
808    @Override
809    public void error(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
810            final Object p3) {
811        logIfEnabled(FQCN, Level.ERROR, marker, message, p0, p1, p2, p3);
812    }
813
814    @Override
815    public void error(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
816            final Object p3, final Object p4) {
817        logIfEnabled(FQCN, Level.ERROR, marker, message, p0, p1, p2, p3, p4);
818    }
819
820    @Override
821    public void error(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
822            final Object p3, final Object p4, final Object p5) {
823        logIfEnabled(FQCN, Level.ERROR, marker, message, p0, p1, p2, p3, p4, p5);
824    }
825
826    @Override
827    public void error(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
828            final Object p3, final Object p4, final Object p5,
829            final Object p6) {
830        logIfEnabled(FQCN, Level.ERROR, marker, message, p0, p1, p2, p3, p4, p5, p6);
831    }
832
833    @Override
834    public void error(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
835            final Object p3, final Object p4, final Object p5,
836            final Object p6, final Object p7) {
837        logIfEnabled(FQCN, Level.ERROR, marker, message, p0, p1, p2, p3, p4, p5, p6, p7);
838    }
839
840    @Override
841    public void error(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
842            final Object p3, final Object p4, final Object p5,
843            final Object p6, final Object p7, final Object p8) {
844        logIfEnabled(FQCN, Level.ERROR, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8);
845    }
846
847    @Override
848    public void error(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
849            final Object p3, final Object p4, final Object p5,
850            final Object p6, final Object p7, final Object p8, final Object p9) {
851        logIfEnabled(FQCN, Level.ERROR, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
852    }
853
854    @Override
855    public void error(final String message, final Object p0) {
856        logIfEnabled(FQCN, Level.ERROR, null, message, p0);
857    }
858
859    @Override
860    public void error(final String message, final Object p0, final Object p1) {
861        logIfEnabled(FQCN, Level.ERROR, null, message, p0, p1);
862    }
863
864    @Override
865    public void error(final String message, final Object p0, final Object p1, final Object p2) {
866        logIfEnabled(FQCN, Level.ERROR, null, message, p0, p1, p2);
867    }
868
869    @Override
870    public void error(final String message, final Object p0, final Object p1, final Object p2, final Object p3) {
871        logIfEnabled(FQCN, Level.ERROR, null, message, p0, p1, p2, p3);
872    }
873
874    @Override
875    public void error(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
876            final Object p4) {
877        logIfEnabled(FQCN, Level.ERROR, null, message, p0, p1, p2, p3, p4);
878    }
879
880    @Override
881    public void error(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
882            final Object p4, final Object p5) {
883        logIfEnabled(FQCN, Level.ERROR, null, message, p0, p1, p2, p3, p4, p5);
884    }
885
886    @Override
887    public void error(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
888            final Object p4, final Object p5, final Object p6) {
889        logIfEnabled(FQCN, Level.ERROR, null, message, p0, p1, p2, p3, p4, p5, p6);
890    }
891
892    @Override
893    public void error(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
894            final Object p4, final Object p5, final Object p6, final Object p7) {
895        logIfEnabled(FQCN, Level.ERROR, null, message, p0, p1, p2, p3, p4, p5, p6, p7);
896    }
897
898    @Override
899    public void error(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
900            final Object p4, final Object p5, final Object p6, final Object p7, final Object p8) {
901        logIfEnabled(FQCN, Level.ERROR, null, message, p0, p1, p2, p3, p4, p5, p6, p7, p8);
902    }
903
904    @Override
905    public void error(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
906            final Object p4, final Object p5, final Object p6, final Object p7, final Object p8, final Object p9) {
907        logIfEnabled(FQCN, Level.ERROR, null, message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
908    }
909
910    @Override
911    public void exit() {
912        exit(FQCN, (Object) null);
913    }
914
915    @Override
916    public <R> R exit(final R result) {
917        return exit(FQCN, result);
918    }
919
920    /**
921     * Logs exiting from a method with the result and location information.
922     *
923     * @param fqcn The fully qualified class name of the <b>caller</b>.
924     * @param <R> The type of the parameter and object being returned.
925     * @param result The result being returned from the method call.
926     * @return the return value passed to this method.
927     */
928    protected <R> R exit(final String fqcn, final R result) {
929        logIfEnabled(fqcn, Level.TRACE, EXIT_MARKER, exitMsg(null, result), null);
930        return result;
931    }
932
933    /**
934     * Logs exiting from a method with the result and location information.
935     *
936     * @param fqcn The fully qualified class name of the <b>caller</b>.
937     * @param <R> The type of the parameter and object being returned.
938     * @param result The result being returned from the method call.
939     * @return the return value passed to this method.
940     */
941    protected <R> R exit(final String fqcn, final String format, final R result) {
942        logIfEnabled(fqcn, Level.TRACE, EXIT_MARKER, exitMsg(format, result), null);
943        return result;
944    }
945
946    protected Message exitMsg(final String format, final Object result) {
947        if (result == null) {
948            if (format == null) {
949                return messageFactory.newMessage("Exit");
950            }
951            return messageFactory.newMessage("Exit: " + format);
952        }
953        if (format == null) {
954            return messageFactory.newMessage("Exit with(" + result + ')');
955        }
956        return messageFactory.newMessage("Exit: " + format, result);
957
958    }
959
960    @Override
961    public void fatal(final Marker marker, final Message msg) {
962        logIfEnabled(FQCN, Level.FATAL, marker, msg, msg != null ? msg.getThrowable() : null);
963    }
964
965    @Override
966    public void fatal(final Marker marker, final Message msg, final Throwable t) {
967        logIfEnabled(FQCN, Level.FATAL, marker, msg, t);
968    }
969
970    @Override
971    public void fatal(final Marker marker, final CharSequence message) {
972        logIfEnabled(FQCN, Level.FATAL, marker, message, null);
973    }
974
975    @Override
976    public void fatal(final Marker marker, final CharSequence message, final Throwable t) {
977        logIfEnabled(FQCN, Level.FATAL, marker, message, t);
978    }
979
980    @Override
981    public void fatal(final Marker marker, final Object message) {
982        logIfEnabled(FQCN, Level.FATAL, marker, message, null);
983    }
984
985    @Override
986    public void fatal(final Marker marker, final Object message, final Throwable t) {
987        logIfEnabled(FQCN, Level.FATAL, marker, message, t);
988    }
989
990    @Override
991    public void fatal(final Marker marker, final String message) {
992        logIfEnabled(FQCN, Level.FATAL, marker, message, (Throwable) null);
993    }
994
995    @Override
996    public void fatal(final Marker marker, final String message, final Object... params) {
997        logIfEnabled(FQCN, Level.FATAL, marker, message, params);
998    }
999
1000    @Override
1001    public void fatal(final Marker marker, final String message, final Throwable t) {
1002        logIfEnabled(FQCN, Level.FATAL, marker, message, t);
1003    }
1004
1005    @Override
1006    public void fatal(final Message msg) {
1007        logIfEnabled(FQCN, Level.FATAL, null, msg, msg != null ? msg.getThrowable() : null);
1008    }
1009
1010    @Override
1011    public void fatal(final Message msg, final Throwable t) {
1012        logIfEnabled(FQCN, Level.FATAL, null, msg, t);
1013    }
1014
1015    @Override
1016    public void fatal(final CharSequence message) {
1017        logIfEnabled(FQCN, Level.FATAL, null, message, null);
1018    }
1019
1020    @Override
1021    public void fatal(final CharSequence message, final Throwable t) {
1022        logIfEnabled(FQCN, Level.FATAL, null, message, t);
1023    }
1024
1025    @Override
1026    public void fatal(final Object message) {
1027        logIfEnabled(FQCN, Level.FATAL, null, message, null);
1028    }
1029
1030    @Override
1031    public void fatal(final Object message, final Throwable t) {
1032        logIfEnabled(FQCN, Level.FATAL, null, message, t);
1033    }
1034
1035    @Override
1036    public void fatal(final String message) {
1037        logIfEnabled(FQCN, Level.FATAL, null, message, (Throwable) null);
1038    }
1039
1040    @Override
1041    public void fatal(final String message, final Object... params) {
1042        logIfEnabled(FQCN, Level.FATAL, null, message, params);
1043    }
1044
1045    @Override
1046    public void fatal(final String message, final Throwable t) {
1047        logIfEnabled(FQCN, Level.FATAL, null, message, t);
1048    }
1049
1050    @Override
1051    public void fatal(final Supplier<?> msgSupplier) {
1052        logIfEnabled(FQCN, Level.FATAL, null, msgSupplier, (Throwable) null);
1053    }
1054
1055    @Override
1056    public void fatal(final Supplier<?> msgSupplier, final Throwable t) {
1057        logIfEnabled(FQCN, Level.FATAL, null, msgSupplier, t);
1058    }
1059
1060    @Override
1061    public void fatal(final Marker marker, final Supplier<?> msgSupplier) {
1062        logIfEnabled(FQCN, Level.FATAL, marker, msgSupplier, (Throwable) null);
1063    }
1064
1065    @Override
1066    public void fatal(final Marker marker, final String message, final Supplier<?>... paramSuppliers) {
1067        logIfEnabled(FQCN, Level.FATAL, marker, message, paramSuppliers);
1068    }
1069
1070    @Override
1071    public void fatal(final Marker marker, final Supplier<?> msgSupplier, final Throwable t) {
1072        logIfEnabled(FQCN, Level.FATAL, marker, msgSupplier, t);
1073    }
1074
1075    @Override
1076    public void fatal(final String message, final Supplier<?>... paramSuppliers) {
1077        logIfEnabled(FQCN, Level.FATAL, null, message, paramSuppliers);
1078    }
1079
1080    @Override
1081    public void fatal(final Marker marker, final MessageSupplier msgSupplier) {
1082        logIfEnabled(FQCN, Level.FATAL, marker, msgSupplier, (Throwable) null);
1083    }
1084
1085    @Override
1086    public void fatal(final Marker marker, final MessageSupplier msgSupplier, final Throwable t) {
1087        logIfEnabled(FQCN, Level.FATAL, marker, msgSupplier, t);
1088    }
1089
1090    @Override
1091    public void fatal(final MessageSupplier msgSupplier) {
1092        logIfEnabled(FQCN, Level.FATAL, null, msgSupplier, (Throwable) null);
1093    }
1094
1095    @Override
1096    public void fatal(final MessageSupplier msgSupplier, final Throwable t) {
1097        logIfEnabled(FQCN, Level.FATAL, null, msgSupplier, t);
1098    }
1099
1100    @Override
1101    public void fatal(final Marker marker, final String message, final Object p0) {
1102        logIfEnabled(FQCN, Level.FATAL, marker, message, p0);
1103    }
1104
1105    @Override
1106    public void fatal(final Marker marker, final String message, final Object p0, final Object p1) {
1107        logIfEnabled(FQCN, Level.FATAL, marker, message, p0, p1);
1108    }
1109
1110    @Override
1111    public void fatal(final Marker marker, final String message, final Object p0, final Object p1, final Object p2) {
1112        logIfEnabled(FQCN, Level.FATAL, marker, message, p0, p1, p2);
1113    }
1114
1115    @Override
1116    public void fatal(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
1117            final Object p3) {
1118        logIfEnabled(FQCN, Level.FATAL, marker, message, p0, p1, p2, p3);
1119    }
1120
1121    @Override
1122    public void fatal(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
1123            final Object p3, final Object p4) {
1124        logIfEnabled(FQCN, Level.FATAL, marker, message, p0, p1, p2, p3, p4);
1125    }
1126
1127    @Override
1128    public void fatal(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
1129            final Object p3, final Object p4, final Object p5) {
1130        logIfEnabled(FQCN, Level.FATAL, marker, message, p0, p1, p2, p3, p4, p5);
1131    }
1132
1133    @Override
1134    public void fatal(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
1135            final Object p3, final Object p4, final Object p5, final Object p6) {
1136        logIfEnabled(FQCN, Level.FATAL, marker, message, p0, p1, p2, p3, p4, p5, p6);
1137    }
1138
1139    @Override
1140    public void fatal(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
1141            final Object p3, final Object p4, final Object p5, final Object p6, final Object p7) {
1142        logIfEnabled(FQCN, Level.FATAL, marker, message, p0, p1, p2, p3, p4, p5, p6, p7);
1143    }
1144
1145    @Override
1146    public void fatal(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
1147            final Object p3, final Object p4, final Object p5,
1148            final Object p6, final Object p7, final Object p8) {
1149        logIfEnabled(FQCN, Level.FATAL, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8);
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, final Object p9) {
1156        logIfEnabled(FQCN, Level.FATAL, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
1157    }
1158
1159    @Override
1160    public void fatal(final String message, final Object p0) {
1161        logIfEnabled(FQCN, Level.FATAL, null, message, p0);
1162    }
1163
1164    @Override
1165    public void fatal(final String message, final Object p0, final Object p1) {
1166        logIfEnabled(FQCN, Level.FATAL, null, message, p0, p1);
1167    }
1168
1169    @Override
1170    public void fatal(final String message, final Object p0, final Object p1, final Object p2) {
1171        logIfEnabled(FQCN, Level.FATAL, null, message, p0, p1, p2);
1172    }
1173
1174    @Override
1175    public void fatal(final String message, final Object p0, final Object p1, final Object p2, final Object p3) {
1176        logIfEnabled(FQCN, Level.FATAL, null, message, p0, p1, p2, p3);
1177    }
1178
1179    @Override
1180    public void fatal(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1181            final Object p4) {
1182        logIfEnabled(FQCN, Level.FATAL, null, message, p0, p1, p2, p3, p4);
1183    }
1184
1185    @Override
1186    public void fatal(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1187            final Object p4, final Object p5) {
1188        logIfEnabled(FQCN, Level.FATAL, null, message, p0, p1, p2, p3, p4, p5);
1189    }
1190
1191    @Override
1192    public void fatal(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1193            final Object p4, final Object p5, final Object p6) {
1194        logIfEnabled(FQCN, Level.FATAL, null, message, p0, p1, p2, p3, p4, p5, p6);
1195    }
1196
1197    @Override
1198    public void fatal(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1199            final Object p4, final Object p5, final Object p6, final Object p7) {
1200        logIfEnabled(FQCN, Level.FATAL, null, message, p0, p1, p2, p3, p4, p5, p6, p7);
1201    }
1202
1203    @Override
1204    public void fatal(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1205            final Object p4, final Object p5, final Object p6, final Object p7, final Object p8) {
1206        logIfEnabled(FQCN, Level.FATAL, null, message, p0, p1, p2, p3, p4, p5, p6, p7, p8);
1207    }
1208
1209    @Override
1210    public void fatal(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1211            final Object p4, final Object p5, final Object p6,
1212            final Object p7, final Object p8, final Object p9) {
1213        logIfEnabled(FQCN, Level.FATAL, null, message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
1214    }
1215
1216    @SuppressWarnings("unchecked")
1217    @Override
1218    public <MF extends MessageFactory> MF getMessageFactory() {
1219        return (MF) messageFactory;
1220    }
1221
1222    @Override
1223    public String getName() {
1224        return name;
1225    }
1226
1227    @Override
1228    public void info(final Marker marker, final Message msg) {
1229        logIfEnabled(FQCN, Level.INFO, marker, msg, msg != null ? msg.getThrowable() : null);
1230    }
1231
1232    @Override
1233    public void info(final Marker marker, final Message msg, final Throwable t) {
1234        logIfEnabled(FQCN, Level.INFO, marker, msg, t);
1235    }
1236
1237    @Override
1238    public void info(final Marker marker, final CharSequence message) {
1239        logIfEnabled(FQCN, Level.INFO, marker, message, null);
1240    }
1241
1242    @Override
1243    public void info(final Marker marker, final CharSequence message, final Throwable t) {
1244        logIfEnabled(FQCN, Level.INFO, marker, message, t);
1245    }
1246
1247    @Override
1248    public void info(final Marker marker, final Object message) {
1249        logIfEnabled(FQCN, Level.INFO, marker, message, null);
1250    }
1251
1252    @Override
1253    public void info(final Marker marker, final Object message, final Throwable t) {
1254        logIfEnabled(FQCN, Level.INFO, marker, message, t);
1255    }
1256
1257    @Override
1258    public void info(final Marker marker, final String message) {
1259        logIfEnabled(FQCN, Level.INFO, marker, message, (Throwable) null);
1260    }
1261
1262    @Override
1263    public void info(final Marker marker, final String message, final Object... params) {
1264        logIfEnabled(FQCN, Level.INFO, marker, message, params);
1265    }
1266
1267    @Override
1268    public void info(final Marker marker, final String message, final Throwable t) {
1269        logIfEnabled(FQCN, Level.INFO, marker, message, t);
1270    }
1271
1272    @Override
1273    public void info(final Message msg) {
1274        logIfEnabled(FQCN, Level.INFO, null, msg, msg != null ? msg.getThrowable() : null);
1275    }
1276
1277    @Override
1278    public void info(final Message msg, final Throwable t) {
1279        logIfEnabled(FQCN, Level.INFO, null, msg, t);
1280    }
1281
1282    @Override
1283    public void info(final CharSequence message) {
1284        logIfEnabled(FQCN, Level.INFO, null, message, null);
1285    }
1286
1287    @Override
1288    public void info(final CharSequence message, final Throwable t) {
1289        logIfEnabled(FQCN, Level.INFO, null, message, t);
1290    }
1291
1292    @Override
1293    public void info(final Object message) {
1294        logIfEnabled(FQCN, Level.INFO, null, message, null);
1295    }
1296
1297    @Override
1298    public void info(final Object message, final Throwable t) {
1299        logIfEnabled(FQCN, Level.INFO, null, message, t);
1300    }
1301
1302    @Override
1303    public void info(final String message) {
1304        logIfEnabled(FQCN, Level.INFO, null, message, (Throwable) null);
1305    }
1306
1307    @Override
1308    public void info(final String message, final Object... params) {
1309        logIfEnabled(FQCN, Level.INFO, null, message, params);
1310    }
1311
1312    @Override
1313    public void info(final String message, final Throwable t) {
1314        logIfEnabled(FQCN, Level.INFO, null, message, t);
1315    }
1316
1317    @Override
1318    public void info(final Supplier<?> msgSupplier) {
1319        logIfEnabled(FQCN, Level.INFO, null, msgSupplier, (Throwable) null);
1320    }
1321
1322    @Override
1323    public void info(final Supplier<?> msgSupplier, final Throwable t) {
1324        logIfEnabled(FQCN, Level.INFO, null, msgSupplier, t);
1325    }
1326
1327    @Override
1328    public void info(final Marker marker, final Supplier<?> msgSupplier) {
1329        logIfEnabled(FQCN, Level.INFO, marker, msgSupplier, (Throwable) null);
1330    }
1331
1332    @Override
1333    public void info(final Marker marker, final String message, final Supplier<?>... paramSuppliers) {
1334        logIfEnabled(FQCN, Level.INFO, marker, message, paramSuppliers);
1335    }
1336
1337    @Override
1338    public void info(final Marker marker, final Supplier<?> msgSupplier, final Throwable t) {
1339        logIfEnabled(FQCN, Level.INFO, marker, msgSupplier, t);
1340    }
1341
1342    @Override
1343    public void info(final String message, final Supplier<?>... paramSuppliers) {
1344        logIfEnabled(FQCN, Level.INFO, null, message, paramSuppliers);
1345    }
1346
1347    @Override
1348    public void info(final Marker marker, final MessageSupplier msgSupplier) {
1349        logIfEnabled(FQCN, Level.INFO, marker, msgSupplier, (Throwable) null);
1350    }
1351
1352    @Override
1353    public void info(final Marker marker, final MessageSupplier msgSupplier, final Throwable t) {
1354        logIfEnabled(FQCN, Level.INFO, marker, msgSupplier, t);
1355    }
1356
1357    @Override
1358    public void info(final MessageSupplier msgSupplier) {
1359        logIfEnabled(FQCN, Level.INFO, null, msgSupplier, (Throwable) null);
1360    }
1361
1362    @Override
1363    public void info(final MessageSupplier msgSupplier, final Throwable t) {
1364        logIfEnabled(FQCN, Level.INFO, null, msgSupplier, t);
1365    }
1366
1367    @Override
1368    public void info(final Marker marker, final String message, final Object p0) {
1369        logIfEnabled(FQCN, Level.INFO, marker, message, p0);
1370    }
1371
1372    @Override
1373    public void info(final Marker marker, final String message, final Object p0, final Object p1) {
1374        logIfEnabled(FQCN, Level.INFO, marker, message, p0, p1);
1375    }
1376
1377    @Override
1378    public void info(final Marker marker, final String message, final Object p0, final Object p1, final Object p2) {
1379        logIfEnabled(FQCN, Level.INFO, marker, message, p0, p1, p2);
1380    }
1381
1382    @Override
1383    public void info(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
1384            final Object p3) {
1385        logIfEnabled(FQCN, Level.INFO, marker, message, p0, p1, p2, p3);
1386    }
1387
1388    @Override
1389    public void info(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
1390            final Object p3, final Object p4) {
1391        logIfEnabled(FQCN, Level.INFO, marker, message, p0, p1, p2, p3, p4);
1392    }
1393
1394    @Override
1395    public void info(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
1396            final Object p3, final Object p4, final Object p5) {
1397        logIfEnabled(FQCN, Level.INFO, marker, message, p0, p1, p2, p3, p4, p5);
1398    }
1399
1400    @Override
1401    public void info(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
1402            final Object p3, final Object p4, final Object p5, final Object p6) {
1403        logIfEnabled(FQCN, Level.INFO, marker, message, p0, p1, p2, p3, p4, p5, p6);
1404    }
1405
1406    @Override
1407    public void info(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
1408            final Object p3, final Object p4, final Object p5, final Object p6, final Object p7) {
1409        logIfEnabled(FQCN, Level.INFO, marker, message, p0, p1, p2, p3, p4, p5, p6, p7);
1410    }
1411
1412    @Override
1413    public void info(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
1414            final Object p3, final Object p4, final Object p5,
1415            final Object p6, final Object p7, final Object p8) {
1416        logIfEnabled(FQCN, Level.INFO, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8);
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, final Object p9) {
1423        logIfEnabled(FQCN, Level.INFO, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
1424    }
1425
1426    @Override
1427    public void info(final String message, final Object p0) {
1428        logIfEnabled(FQCN, Level.INFO, null, message, p0);
1429    }
1430
1431    @Override
1432    public void info(final String message, final Object p0, final Object p1) {
1433        logIfEnabled(FQCN, Level.INFO, null, message, p0, p1);
1434    }
1435
1436    @Override
1437    public void info(final String message, final Object p0, final Object p1, final Object p2) {
1438        logIfEnabled(FQCN, Level.INFO, null, message, p0, p1, p2);
1439    }
1440
1441    @Override
1442    public void info(final String message, final Object p0, final Object p1, final Object p2, final Object p3) {
1443        logIfEnabled(FQCN, Level.INFO, null, message, p0, p1, p2, p3);
1444    }
1445
1446    @Override
1447    public void info(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1448            final Object p4) {
1449        logIfEnabled(FQCN, Level.INFO, null, message, p0, p1, p2, p3, p4);
1450    }
1451
1452    @Override
1453    public void info(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1454            final Object p4, final Object p5) {
1455        logIfEnabled(FQCN, Level.INFO, null, message, p0, p1, p2, p3, p4, p5);
1456    }
1457
1458    @Override
1459    public void info(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1460            final Object p4, final Object p5, final Object p6) {
1461        logIfEnabled(FQCN, Level.INFO, null, message, p0, p1, p2, p3, p4, p5, p6);
1462    }
1463
1464    @Override
1465    public void info(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1466            final Object p4, final Object p5, final Object p6,
1467            final Object p7) {
1468        logIfEnabled(FQCN, Level.INFO, null, message, p0, p1, p2, p3, p4, p5, p6, p7);
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, final Object p8) {
1475        logIfEnabled(FQCN, Level.INFO, null, message, p0, p1, p2, p3, p4, p5, p6, p7, p8);
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, final Object p9) {
1482        logIfEnabled(FQCN, Level.INFO, null, message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
1483    }
1484
1485    @Override
1486    public boolean isDebugEnabled() {
1487        return isEnabled(Level.DEBUG, null, null);
1488    }
1489
1490    @Override
1491    public boolean isDebugEnabled(final Marker marker) {
1492        return isEnabled(Level.DEBUG, marker, (Object) null, null);
1493    }
1494
1495    @Override
1496    public boolean isEnabled(final Level level) {
1497        return isEnabled(level, null, (Object) null, null);
1498    }
1499
1500    @Override
1501    public boolean isEnabled(final Level level, final Marker marker) {
1502        return isEnabled(level, marker, (Object) null, null);
1503    }
1504
1505    @Override
1506    public boolean isErrorEnabled() {
1507        return isEnabled(Level.ERROR, null, (Object) null, null);
1508    }
1509
1510    @Override
1511    public boolean isErrorEnabled(final Marker marker) {
1512        return isEnabled(Level.ERROR, marker, (Object) null, null);
1513    }
1514
1515    @Override
1516    public boolean isFatalEnabled() {
1517        return isEnabled(Level.FATAL, null, (Object) null, null);
1518    }
1519
1520    @Override
1521    public boolean isFatalEnabled(final Marker marker) {
1522        return isEnabled(Level.FATAL, marker, (Object) null, null);
1523    }
1524
1525    @Override
1526    public boolean isInfoEnabled() {
1527        return isEnabled(Level.INFO, null, (Object) null, null);
1528    }
1529
1530    @Override
1531    public boolean isInfoEnabled(final Marker marker) {
1532        return isEnabled(Level.INFO, marker, (Object) null, null);
1533    }
1534
1535    @Override
1536    public boolean isTraceEnabled() {
1537        return isEnabled(Level.TRACE, null, (Object) null, null);
1538    }
1539
1540    @Override
1541    public boolean isTraceEnabled(final Marker marker) {
1542        return isEnabled(Level.TRACE, marker, (Object) null, null);
1543    }
1544
1545    @Override
1546    public boolean isWarnEnabled() {
1547        return isEnabled(Level.WARN, null, (Object) null, null);
1548    }
1549
1550    @Override
1551    public boolean isWarnEnabled(final Marker marker) {
1552        return isEnabled(Level.WARN, marker, (Object) null, null);
1553    }
1554
1555    @Override
1556    public void log(final Level level, final Marker marker, final Message msg) {
1557        logIfEnabled(FQCN, level, marker, msg, msg != null ? msg.getThrowable() : null);
1558    }
1559
1560    @Override
1561    public void log(final Level level, final Marker marker, final Message msg, final Throwable t) {
1562        logIfEnabled(FQCN, level, marker, msg, t);
1563    }
1564
1565    @Override
1566    public void log(final Level level, final Marker marker, final CharSequence message) {
1567        logIfEnabled(FQCN, level, marker, message, (Throwable) null);
1568    }
1569
1570    @Override
1571    public void log(final Level level, final Marker marker, final CharSequence message, final Throwable t) {
1572        if (isEnabled(level, marker, message, t)) {
1573            logMessage(FQCN, level, marker, message, t);
1574        }
1575    }
1576
1577    @Override
1578    public void log(final Level level, final Marker marker, final Object message) {
1579        logIfEnabled(FQCN, level, marker, message, (Throwable) null);
1580    }
1581
1582    @Override
1583    public void log(final Level level, final Marker marker, final Object message, final Throwable t) {
1584        if (isEnabled(level, marker, message, t)) {
1585            logMessage(FQCN, level, marker, message, t);
1586        }
1587    }
1588
1589    @Override
1590    public void log(final Level level, final Marker marker, final String message) {
1591        logIfEnabled(FQCN, level, marker, message, (Throwable) null);
1592    }
1593
1594    @Override
1595    public void log(final Level level, final Marker marker, final String message, final Object... params) {
1596        logIfEnabled(FQCN, level, marker, message, params);
1597    }
1598
1599    @Override
1600    public void log(final Level level, final Marker marker, final String message, final Throwable t) {
1601        logIfEnabled(FQCN, level, marker, message, t);
1602    }
1603
1604    @Override
1605    public void log(final Level level, final Message msg) {
1606        logIfEnabled(FQCN, level, null, msg, msg != null ? msg.getThrowable() : null);
1607    }
1608
1609    @Override
1610    public void log(final Level level, final Message msg, final Throwable t) {
1611        logIfEnabled(FQCN, level, null, msg, t);
1612    }
1613
1614    @Override
1615    public void log(final Level level, final CharSequence message) {
1616        logIfEnabled(FQCN, level, null, message, null);
1617    }
1618
1619    @Override
1620    public void log(final Level level, final CharSequence message, final Throwable t) {
1621        logIfEnabled(FQCN, level, null, message, t);
1622    }
1623
1624    @Override
1625    public void log(final Level level, final Object message) {
1626        logIfEnabled(FQCN, level, null, message, null);
1627    }
1628
1629    @Override
1630    public void log(final Level level, final Object message, final Throwable t) {
1631        logIfEnabled(FQCN, level, null, message, t);
1632    }
1633
1634    @Override
1635    public void log(final Level level, final String message) {
1636        logIfEnabled(FQCN, level, null, message, (Throwable) null);
1637    }
1638
1639    @Override
1640    public void log(final Level level, final String message, final Object... params) {
1641        logIfEnabled(FQCN, level, null, message, params);
1642    }
1643
1644    @Override
1645    public void log(final Level level, final String message, final Throwable t) {
1646        logIfEnabled(FQCN, level, null, message, t);
1647    }
1648
1649    @Override
1650    public void log(final Level level, final Supplier<?> msgSupplier) {
1651        logIfEnabled(FQCN, level, null, msgSupplier, (Throwable) null);
1652    }
1653
1654    @Override
1655    public void log(final Level level, final Supplier<?> msgSupplier, final Throwable t) {
1656        logIfEnabled(FQCN, level, null, msgSupplier, t);
1657    }
1658
1659    @Override
1660    public void log(final Level level, final Marker marker, final Supplier<?> msgSupplier) {
1661        logIfEnabled(FQCN, level, marker, msgSupplier, (Throwable) null);
1662    }
1663
1664    @Override
1665    public void log(final Level level, final Marker marker, final String message, final Supplier<?>... paramSuppliers) {
1666        logIfEnabled(FQCN, level, marker, message, paramSuppliers);
1667    }
1668
1669    @Override
1670    public void log(final Level level, final Marker marker, final Supplier<?> msgSupplier, final Throwable t) {
1671        logIfEnabled(FQCN, level, marker, msgSupplier, t);
1672    }
1673
1674    @Override
1675    public void log(final Level level, final String message, final Supplier<?>... paramSuppliers) {
1676        logIfEnabled(FQCN, level, null, message, paramSuppliers);
1677    }
1678
1679    @Override
1680    public void log(final Level level, final Marker marker, final MessageSupplier msgSupplier) {
1681        logIfEnabled(FQCN, level, marker, msgSupplier, (Throwable) null);
1682    }
1683
1684    @Override
1685    public void log(final Level level, final Marker marker, final MessageSupplier msgSupplier, final Throwable t) {
1686        logIfEnabled(FQCN, level, marker, msgSupplier, t);
1687    }
1688
1689    @Override
1690    public void log(final Level level, final MessageSupplier msgSupplier) {
1691        logIfEnabled(FQCN, level, null, msgSupplier, (Throwable) null);
1692    }
1693
1694    @Override
1695    public void log(final Level level, final MessageSupplier msgSupplier, final Throwable t) {
1696        logIfEnabled(FQCN, level, null, msgSupplier, t);
1697    }
1698
1699    @Override
1700    public void log(final Level level, final Marker marker, final String message, final Object p0) {
1701        logIfEnabled(FQCN, level, marker, message, p0);
1702    }
1703
1704    @Override
1705    public void log(final Level level, final Marker marker, final String message, final Object p0, final Object p1) {
1706        logIfEnabled(FQCN, level, marker, message, p0, p1);
1707    }
1708
1709    @Override
1710    public void log(final Level level, final Marker marker, final String message, final Object p0, final Object p1,
1711            final Object p2) {
1712        logIfEnabled(FQCN, level, marker, message, p0, p1, p2);
1713    }
1714
1715    @Override
1716    public void log(final Level level, final Marker marker, final String message, final Object p0, final Object p1,
1717            final Object p2, final Object p3) {
1718        logIfEnabled(FQCN, level, marker, message, p0, p1, p2, p3);
1719    }
1720
1721    @Override
1722    public void log(final Level level, final Marker marker, final String message, final Object p0, final Object p1,
1723            final Object p2, final Object p3, final Object p4) {
1724        logIfEnabled(FQCN, level, marker, message, p0, p1, p2, p3, p4);
1725    }
1726
1727    @Override
1728    public void log(final Level level, final Marker marker, final String message, final Object p0, final Object p1,
1729            final Object p2, final Object p3, final Object p4, final Object p5) {
1730        logIfEnabled(FQCN, level, marker, message, p0, p1, p2, p3, p4, p5);
1731    }
1732
1733    @Override
1734    public void log(final Level level, final Marker marker, final String message, final Object p0, final Object p1,
1735            final Object p2, final Object p3, final Object p4, final Object p5, final Object p6) {
1736        logIfEnabled(FQCN, level, marker, message, p0, p1, p2, p3, p4, p5, p6);
1737    }
1738
1739    @Override
1740    public void log(final Level level, final Marker marker, final String message, final Object p0, final Object p1,
1741            final Object p2, final Object p3, final Object p4, final Object p5,
1742            final Object p6, final Object p7) {
1743        logIfEnabled(FQCN, level, marker, message, p0, p1, p2, p3, p4, p5, p6, p7);
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, final Object p8) {
1750        logIfEnabled(FQCN, level, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8);
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, final Object p9) {
1757        logIfEnabled(FQCN, level, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
1758    }
1759
1760    @Override
1761    public void log(final Level level, final String message, final Object p0) {
1762        logIfEnabled(FQCN, level, null, message, p0);
1763    }
1764
1765    @Override
1766    public void log(final Level level, final String message, final Object p0, final Object p1) {
1767        logIfEnabled(FQCN, level, null, message, p0, p1);
1768    }
1769
1770    @Override
1771    public void log(final Level level, final String message, final Object p0, final Object p1, final Object p2) {
1772        logIfEnabled(FQCN, level, null, message, p0, p1, p2);
1773    }
1774
1775    @Override
1776    public void log(final Level level, final String message, final Object p0, final Object p1, final Object p2, final Object p3) {
1777        logIfEnabled(FQCN, level, null, message, p0, p1, p2, p3);
1778    }
1779
1780    @Override
1781    public void log(final Level level, final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1782            final Object p4) {
1783        logIfEnabled(FQCN, level, null, message, p0, p1, p2, p3, p4);
1784    }
1785
1786    @Override
1787    public void log(final Level level, final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1788            final Object p4, final Object p5) {
1789        logIfEnabled(FQCN, level, null, message, p0, p1, p2, p3, p4, p5);
1790    }
1791
1792    @Override
1793    public void log(final Level level, final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1794            final Object p4, final Object p5, final Object p6) {
1795        logIfEnabled(FQCN, level, null, message, p0, p1, p2, p3, p4, p5, p6);
1796    }
1797
1798    @Override
1799    public void log(final Level level, final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1800            final Object p4, final Object p5, final Object p6, final Object p7) {
1801        logIfEnabled(FQCN, level, null, message, p0, p1, p2, p3, p4, p5, p6, p7);
1802    }
1803
1804    @Override
1805    public void log(final Level level, final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1806            final Object p4, final Object p5, final Object p6, final Object p7, final Object p8) {
1807        logIfEnabled(FQCN, level, null, message, p0, p1, p2, p3, p4, p5, p6, p7, p8);
1808    }
1809
1810    @Override
1811    public void log(final Level level, final String message, final Object p0, final Object p1, final Object p2, final Object p3,
1812            final Object p4, final Object p5, final Object p6, final Object p7, final Object p8, final Object p9) {
1813        logIfEnabled(FQCN, level, null, message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
1814    }
1815
1816    @Override
1817    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final Message msg,
1818            final Throwable t) {
1819        if (isEnabled(level, marker, msg, t)) {
1820            logMessageSafely(fqcn, level, marker, msg, t);
1821        }
1822    }
1823
1824    @Override
1825    public void logIfEnabled(final String fqcn, final Level level, final Marker marker,
1826            final MessageSupplier msgSupplier, final Throwable t) {
1827        if (isEnabled(level, marker, msgSupplier, t)) {
1828            logMessage(fqcn, level, marker, msgSupplier, t);
1829        }
1830    }
1831
1832    @Override
1833    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final Object message,
1834            final Throwable t) {
1835        if (isEnabled(level, marker, message, t)) {
1836            logMessage(fqcn, level, marker, message, t);
1837        }
1838    }
1839
1840    @Override
1841    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final CharSequence message,
1842            final Throwable t) {
1843        if (isEnabled(level, marker, message, t)) {
1844            logMessage(fqcn, level, marker, message, t);
1845        }
1846    }
1847
1848    @Override
1849    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final Supplier<?> msgSupplier,
1850            final Throwable t) {
1851        if (isEnabled(level, marker, msgSupplier, t)) {
1852            logMessage(fqcn, level, marker, msgSupplier, t);
1853        }
1854    }
1855
1856    @Override
1857    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final String message) {
1858        if (isEnabled(level, marker, message)) {
1859            logMessage(fqcn, level, marker, message);
1860        }
1861    }
1862
1863    @Override
1864    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final String message,
1865            final Supplier<?>... paramSuppliers) {
1866        if (isEnabled(level, marker, message)) {
1867            logMessage(fqcn, level, marker, message, paramSuppliers);
1868        }
1869    }
1870
1871    @Override
1872    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final String message,
1873            final Object... params) {
1874        if (isEnabled(level, marker, message, params)) {
1875            logMessage(fqcn, level, marker, message, params);
1876        }
1877    }
1878
1879    @Override
1880    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final String message,
1881            final Object p0) {
1882        if (isEnabled(level, marker, message, p0)) {
1883            logMessage(fqcn, level, marker, message, p0);
1884        }
1885    }
1886
1887    @Override
1888    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final String message,
1889            final Object p0, final Object p1) {
1890        if (isEnabled(level, marker, message, p0, p1)) {
1891            logMessage(fqcn, level, marker, message, p0, p1);
1892        }
1893    }
1894
1895    @Override
1896    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final String message,
1897            final Object p0, final Object p1, final Object p2) {
1898        if (isEnabled(level, marker, message, p0, p1, p2)) {
1899            logMessage(fqcn, level, marker, message, p0, p1, p2);
1900        }
1901    }
1902
1903    @Override
1904    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final String message,
1905            final Object p0, final Object p1, final Object p2, final Object p3) {
1906        if (isEnabled(level, marker, message, p0, p1, p2, p3)) {
1907            logMessage(fqcn, level, marker, message, p0, p1, p2, p3);
1908        }
1909    }
1910
1911    @Override
1912    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final String message,
1913            final Object p0, final Object p1, final Object p2, final Object p3, final Object p4) {
1914        if (isEnabled(level, marker, message, p0, p1, p2, p3, p4)) {
1915            logMessage(fqcn, level, marker, message, p0, p1, p2, p3, p4);
1916        }
1917    }
1918
1919    @Override
1920    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final String message,
1921            final Object p0, final Object p1, final Object p2, final Object p3, final Object p4, final Object p5) {
1922        if (isEnabled(level, marker, message, p0, p1, p2, p3, p4, p5)) {
1923            logMessage(fqcn, level, marker, message, p0, p1, p2, p3, p4, p5);
1924        }
1925    }
1926
1927    @Override
1928    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final String message,
1929            final Object p0, final Object p1, final Object p2, final Object p3, final Object p4, final Object p5,
1930            final Object p6) {
1931        if (isEnabled(level, marker, message, p0, p1, p2, p3, p4, p5, p6)) {
1932            logMessage(fqcn, level, marker, message, p0, p1, p2, p3, p4, p5, p6);
1933        }
1934    }
1935
1936    @Override
1937    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final String message,
1938            final Object p0, final Object p1, final Object p2, final Object p3, final Object p4, final Object p5,
1939            final Object p6, final Object p7) {
1940        if (isEnabled(level, marker, message, p0, p1, p2, p3, p4, p5, p6, p7)) {
1941            logMessage(fqcn, level, marker, message, p0, p1, p2, p3, p4, p5, p6, p7);
1942        }
1943    }
1944
1945    @Override
1946    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final String message,
1947            final Object p0, final Object p1, final Object p2, final Object p3, final Object p4, final Object p5,
1948            final Object p6, final Object p7, final Object p8) {
1949        if (isEnabled(level, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8)) {
1950            logMessage(fqcn, level, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8);
1951        }
1952    }
1953
1954    @Override
1955    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final String message,
1956            final Object p0, final Object p1, final Object p2, final Object p3, final Object p4, final Object p5,
1957            final Object p6, final Object p7, final Object p8, final Object p9) {
1958        if (isEnabled(level, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)) {
1959            logMessage(fqcn, level, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
1960        }
1961    }
1962
1963    @Override
1964    public void logIfEnabled(final String fqcn, final Level level, final Marker marker, final String message,
1965            final Throwable t) {
1966        if (isEnabled(level, marker, message, t)) {
1967            logMessage(fqcn, level, marker, message, t);
1968        }
1969    }
1970
1971    protected void logMessage(final String fqcn, final Level level, final Marker marker, final CharSequence message,
1972            final Throwable t) {
1973        logMessageSafely(fqcn, level, marker, messageFactory.newMessage(message), t);
1974    }
1975
1976    protected void logMessage(final String fqcn, final Level level, final Marker marker, final Object message,
1977            final Throwable t) {
1978        logMessageSafely(fqcn, level, marker, messageFactory.newMessage(message), t);
1979    }
1980
1981    protected void logMessage(final String fqcn, final Level level, final Marker marker,
1982            final MessageSupplier msgSupplier, final Throwable t) {
1983        final Message message = LambdaUtil.get(msgSupplier);
1984        logMessageSafely(fqcn, level, marker, message, (t == null && message != null) ? message.getThrowable() : t);
1985    }
1986
1987    protected void logMessage(final String fqcn, final Level level, final Marker marker, final Supplier<?> msgSupplier,
1988            final Throwable t) {
1989        final Message message = LambdaUtil.getMessage(msgSupplier, messageFactory);
1990        logMessageSafely(fqcn, level, marker, message, (t == null && message != null) ? message.getThrowable() : t);
1991    }
1992
1993    protected void logMessage(final String fqcn, final Level level, final Marker marker, final String message,
1994            final Throwable t) {
1995        logMessageSafely(fqcn, level, marker, messageFactory.newMessage(message), t);
1996    }
1997
1998    protected void logMessage(final String fqcn, final Level level, final Marker marker, final String message) {
1999        final Message msg = messageFactory.newMessage(message);
2000        logMessageSafely(fqcn, level, marker, msg, msg.getThrowable());
2001    }
2002
2003    protected void logMessage(final String fqcn, final Level level, final Marker marker, final String message,
2004            final Object... params) {
2005        final Message msg = messageFactory.newMessage(message, params);
2006        logMessageSafely(fqcn, level, marker, msg, msg.getThrowable());
2007    }
2008
2009    protected void logMessage(final String fqcn, final Level level, final Marker marker, final String message,
2010            final Object p0) {
2011        final Message msg = messageFactory.newMessage(message, p0);
2012        logMessageSafely(fqcn, level, marker, msg, msg.getThrowable());
2013    }
2014
2015    protected void logMessage(final String fqcn, final Level level, final Marker marker, final String message,
2016            final Object p0, final Object p1) {
2017        final Message msg = messageFactory.newMessage(message, p0, p1);
2018        logMessageSafely(fqcn, level, marker, msg, msg.getThrowable());
2019    }
2020
2021    protected void logMessage(final String fqcn, final Level level, final Marker marker, final String message,
2022            final Object p0, final Object p1, final Object p2) {
2023        final Message msg = messageFactory.newMessage(message, p0, p1, p2);
2024        logMessageSafely(fqcn, level, marker, msg, msg.getThrowable());
2025    }
2026
2027    protected void logMessage(final String fqcn, final Level level, final Marker marker, final String message,
2028            final Object p0, final Object p1, final Object p2, final Object p3) {
2029        final Message msg = messageFactory.newMessage(message, p0, p1, p2, p3);
2030        logMessageSafely(fqcn, level, marker, msg, msg.getThrowable());
2031    }
2032
2033    protected void logMessage(final String fqcn, final Level level, final Marker marker, final String message,
2034            final Object p0, final Object p1, final Object p2, final Object p3, final Object p4) {
2035        final Message msg = messageFactory.newMessage(message, p0, p1, p2, p3, p4);
2036        logMessageSafely(fqcn, level, marker, msg, msg.getThrowable());
2037    }
2038
2039    protected void logMessage(final String fqcn, final Level level, final Marker marker, final String message,
2040            final Object p0, final Object p1, final Object p2, final Object p3, final Object p4, final Object p5) {
2041        final Message msg = messageFactory.newMessage(message, p0, p1, p2, p3, p4, p5);
2042        logMessageSafely(fqcn, level, marker, msg, msg.getThrowable());
2043    }
2044
2045    protected void logMessage(final String fqcn, final Level level, final Marker marker, final String message,
2046            final Object p0, final Object p1, final Object p2, final Object p3, final Object p4, final Object p5,
2047            final Object p6) {
2048        final Message msg = messageFactory.newMessage(message, p0, p1, p2, p3, p4, p5, p6);
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, final Object p7) {
2055        final Message msg = messageFactory.newMessage(message, p0, p1, p2, p3, p4, p5, p6, p7);
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, final Object p8) {
2062        final Message msg = messageFactory.newMessage(message, p0, p1, p2, p3, p4, p5, p6, p7, p8);
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, final Object p9) {
2069        final Message msg = messageFactory.newMessage(message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
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 Supplier<?>... paramSuppliers) {
2075        final Message msg = messageFactory.newMessage(message, LambdaUtil.getAll(paramSuppliers));
2076        logMessageSafely(fqcn, level, marker, msg, msg.getThrowable());
2077    }
2078
2079    @Override
2080    public void printf(final Level level, final Marker marker, final String format, final Object... params) {
2081        if (isEnabled(level, marker, format, params)) {
2082            final Message msg = new StringFormattedMessage(format, params);
2083            logMessageSafely(FQCN, level, marker, msg, msg.getThrowable());
2084        }
2085    }
2086
2087    @Override
2088    public void printf(final Level level, final String format, final Object... params) {
2089        if (isEnabled(level, null, format, params)) {
2090            final Message msg = new StringFormattedMessage(format, params);
2091            logMessageSafely(FQCN, level, null, msg, msg.getThrowable());
2092        }
2093    }
2094
2095    @PerformanceSensitive
2096    // NOTE: This is a hot method. Current implementation compiles to 30 bytes of byte code.
2097    // This is within the 35 byte MaxInlineSize threshold. Modify with care!
2098    private void logMessageSafely(final String fqcn, final Level level, final Marker marker, final Message msg,
2099            final Throwable throwable) {
2100        try {
2101            logMessageTrackRecursion(fqcn, level, marker, msg, throwable);
2102        } finally {
2103            // LOG4J2-1583 prevent scrambled logs when logging calls are nested (logging in toString())
2104            ReusableMessageFactory.release(msg);
2105        }
2106    }
2107
2108    @PerformanceSensitive
2109    // NOTE: This is a hot method. Current implementation compiles to 29 bytes of byte code.
2110    // This is within the 35 byte MaxInlineSize threshold. Modify with care!
2111    private void logMessageTrackRecursion(final String fqcn,
2112                                          final Level level,
2113                                          final Marker marker,
2114                                          final Message msg,
2115                                          final Throwable throwable) {
2116        try {
2117            incrementRecursionDepth(); // LOG4J2-1518, LOG4J2-2031
2118            tryLogMessage(fqcn, level, marker, msg, throwable);
2119        } finally {
2120            decrementRecursionDepth();
2121        }
2122    }
2123
2124    private static int[] getRecursionDepthHolder() {
2125        int[] result = recursionDepthHolder.get();
2126        if (result == null) {
2127            result = new int[1];
2128            recursionDepthHolder.set(result);
2129        }
2130        return result;
2131    }
2132
2133    private static void incrementRecursionDepth() {
2134        getRecursionDepthHolder()[0]++;
2135    }
2136    private static void decrementRecursionDepth() {
2137        int[] depth = getRecursionDepthHolder();
2138        depth[0]--;
2139        if (depth[0] < 0) {
2140            throw new IllegalStateException("Recursion depth became negative: " + depth[0]);
2141        }
2142    }
2143
2144    /**
2145     * Returns the depth of nested logging calls in the current Thread: zero if no logging call has been made,
2146     * one if a single logging call without nested logging calls has been made, or more depending on the level of
2147     * nesting.
2148     * @return the depth of the nested logging calls in the current Thread
2149     */
2150    public static int getRecursionDepth() {
2151        return getRecursionDepthHolder()[0];
2152    }
2153
2154    @PerformanceSensitive
2155    // NOTE: This is a hot method. Current implementation compiles to 26 bytes of byte code.
2156    // This is within the 35 byte MaxInlineSize threshold. Modify with care!
2157    private void tryLogMessage(final String fqcn,
2158                               final Level level,
2159                               final Marker marker,
2160                               final Message msg,
2161                               final Throwable throwable) {
2162        try {
2163            logMessage(fqcn, level, marker, msg, throwable);
2164        } catch (final Exception e) {
2165            // LOG4J2-1990 Log4j2 suppresses all exceptions that occur once application called the logger
2166            handleLogMessageException(e, fqcn, msg);
2167        }
2168    }
2169
2170    // LOG4J2-1990 Log4j2 suppresses all exceptions that occur once application called the logger
2171    // TODO Configuration setting to propagate exceptions back to the caller *if requested*
2172    private void handleLogMessageException(final Exception exception, final String fqcn, final Message msg) {
2173        if (exception instanceof LoggingException) {
2174            throw (LoggingException) exception;
2175        }
2176        final String format = msg.getFormat();
2177        final StringBuilder sb = new StringBuilder(format.length() + 100);
2178        sb.append(fqcn);
2179        sb.append(" caught ");
2180        sb.append(exception.getClass().getName());
2181        sb.append(" logging ");
2182        sb.append(msg.getClass().getSimpleName());
2183        sb.append(": ");
2184        sb.append(format);
2185        StatusLogger.getLogger().warn(sb.toString(), exception);
2186    }
2187
2188    @Override
2189    public <T extends Throwable> T throwing(final T t) {
2190        return throwing(FQCN, Level.ERROR, t);
2191    }
2192
2193    @Override
2194    public <T extends Throwable> T throwing(final Level level, final T t) {
2195        return throwing(FQCN, level, t);
2196    }
2197
2198    /**
2199     * Logs a Throwable to be thrown.
2200     *
2201     * @param <T> the type of the Throwable.
2202     * @param fqcn the fully qualified class name of this Logger implementation.
2203     * @param level The logging Level.
2204     * @param t The Throwable.
2205     * @return the Throwable.
2206     */
2207    protected <T extends Throwable> T throwing(final String fqcn, final Level level, final T t) {
2208        if (isEnabled(level, THROWING_MARKER, (Object) null, null)) {
2209            logMessageSafely(fqcn, level, THROWING_MARKER, throwingMsg(t), t);
2210        }
2211        return t;
2212    }
2213
2214    protected Message throwingMsg(final Throwable t) {
2215        return messageFactory.newMessage(THROWING);
2216    }
2217
2218    @Override
2219    public void trace(final Marker marker, final Message msg) {
2220        logIfEnabled(FQCN, Level.TRACE, marker, msg, msg != null ? msg.getThrowable() : null);
2221    }
2222
2223    @Override
2224    public void trace(final Marker marker, final Message msg, final Throwable t) {
2225        logIfEnabled(FQCN, Level.TRACE, marker, msg, t);
2226    }
2227
2228    @Override
2229    public void trace(final Marker marker, final CharSequence message) {
2230        logIfEnabled(FQCN, Level.TRACE, marker, message, null);
2231    }
2232
2233    @Override
2234    public void trace(final Marker marker, final CharSequence message, final Throwable t) {
2235        logIfEnabled(FQCN, Level.TRACE, marker, message, t);
2236    }
2237
2238    @Override
2239    public void trace(final Marker marker, final Object message) {
2240        logIfEnabled(FQCN, Level.TRACE, marker, message, null);
2241    }
2242
2243    @Override
2244    public void trace(final Marker marker, final Object message, final Throwable t) {
2245        logIfEnabled(FQCN, Level.TRACE, marker, message, t);
2246    }
2247
2248    @Override
2249    public void trace(final Marker marker, final String message) {
2250        logIfEnabled(FQCN, Level.TRACE, marker, message, (Throwable) null);
2251    }
2252
2253    @Override
2254    public void trace(final Marker marker, final String message, final Object... params) {
2255        logIfEnabled(FQCN, Level.TRACE, marker, message, params);
2256    }
2257
2258    @Override
2259    public void trace(final Marker marker, final String message, final Throwable t) {
2260        logIfEnabled(FQCN, Level.TRACE, marker, message, t);
2261    }
2262
2263    @Override
2264    public void trace(final Message msg) {
2265        logIfEnabled(FQCN, Level.TRACE, null, msg, msg != null ? msg.getThrowable() : null);
2266    }
2267
2268    @Override
2269    public void trace(final Message msg, final Throwable t) {
2270        logIfEnabled(FQCN, Level.TRACE, null, msg, t);
2271    }
2272
2273    @Override
2274    public void trace(final CharSequence message) {
2275        logIfEnabled(FQCN, Level.TRACE, null, message, null);
2276    }
2277
2278    @Override
2279    public void trace(final CharSequence message, final Throwable t) {
2280        logIfEnabled(FQCN, Level.TRACE, null, message, t);
2281    }
2282
2283    @Override
2284    public void trace(final Object message) {
2285        logIfEnabled(FQCN, Level.TRACE, null, message, null);
2286    }
2287
2288    @Override
2289    public void trace(final Object message, final Throwable t) {
2290        logIfEnabled(FQCN, Level.TRACE, null, message, t);
2291    }
2292
2293    @Override
2294    public void trace(final String message) {
2295        logIfEnabled(FQCN, Level.TRACE, null, message, (Throwable) null);
2296    }
2297
2298    @Override
2299    public void trace(final String message, final Object... params) {
2300        logIfEnabled(FQCN, Level.TRACE, null, message, params);
2301    }
2302
2303    @Override
2304    public void trace(final String message, final Throwable t) {
2305        logIfEnabled(FQCN, Level.TRACE, null, message, t);
2306    }
2307
2308    @Override
2309    public void trace(final Supplier<?> msgSupplier) {
2310        logIfEnabled(FQCN, Level.TRACE, null, msgSupplier, (Throwable) null);
2311    }
2312
2313    @Override
2314    public void trace(final Supplier<?> msgSupplier, final Throwable t) {
2315        logIfEnabled(FQCN, Level.TRACE, null, msgSupplier, t);
2316    }
2317
2318    @Override
2319    public void trace(final Marker marker, final Supplier<?> msgSupplier) {
2320        logIfEnabled(FQCN, Level.TRACE, marker, msgSupplier, (Throwable) null);
2321    }
2322
2323    @Override
2324    public void trace(final Marker marker, final String message, final Supplier<?>... paramSuppliers) {
2325        logIfEnabled(FQCN, Level.TRACE, marker, message, paramSuppliers);
2326    }
2327
2328    @Override
2329    public void trace(final Marker marker, final Supplier<?> msgSupplier, final Throwable t) {
2330        logIfEnabled(FQCN, Level.TRACE, marker, msgSupplier, t);
2331    }
2332
2333    @Override
2334    public void trace(final String message, final Supplier<?>... paramSuppliers) {
2335        logIfEnabled(FQCN, Level.TRACE, null, message, paramSuppliers);
2336    }
2337
2338    @Override
2339    public void trace(final Marker marker, final MessageSupplier msgSupplier) {
2340        logIfEnabled(FQCN, Level.TRACE, marker, msgSupplier, (Throwable) null);
2341    }
2342
2343    @Override
2344    public void trace(final Marker marker, final MessageSupplier msgSupplier, final Throwable t) {
2345        logIfEnabled(FQCN, Level.TRACE, marker, msgSupplier, t);
2346    }
2347
2348    @Override
2349    public void trace(final MessageSupplier msgSupplier) {
2350        logIfEnabled(FQCN, Level.TRACE, null, msgSupplier, (Throwable) null);
2351    }
2352
2353    @Override
2354    public void trace(final MessageSupplier msgSupplier, final Throwable t) {
2355        logIfEnabled(FQCN, Level.TRACE, null, msgSupplier, t);
2356    }
2357
2358    @Override
2359    public void trace(final Marker marker, final String message, final Object p0) {
2360        logIfEnabled(FQCN, Level.TRACE, marker, message, p0);
2361    }
2362
2363    @Override
2364    public void trace(final Marker marker, final String message, final Object p0, final Object p1) {
2365        logIfEnabled(FQCN, Level.TRACE, marker, message, p0, p1);
2366    }
2367
2368    @Override
2369    public void trace(final Marker marker, final String message, final Object p0, final Object p1, final Object p2) {
2370        logIfEnabled(FQCN, Level.TRACE, marker, message, p0, p1, p2);
2371    }
2372
2373    @Override
2374    public void trace(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
2375            final Object p3) {
2376        logIfEnabled(FQCN, Level.TRACE, marker, message, p0, p1, p2, p3);
2377    }
2378
2379    @Override
2380    public void trace(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
2381            final Object p3, final Object p4) {
2382        logIfEnabled(FQCN, Level.TRACE, marker, message, p0, p1, p2, p3, p4);
2383    }
2384
2385    @Override
2386    public void trace(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
2387            final Object p3, final Object p4, final Object p5) {
2388        logIfEnabled(FQCN, Level.TRACE, marker, message, p0, p1, p2, p3, p4, p5);
2389    }
2390
2391    @Override
2392    public void trace(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
2393            final Object p3, final Object p4, final Object p5, final Object p6) {
2394        logIfEnabled(FQCN, Level.TRACE, marker, message, p0, p1, p2, p3, p4, p5, p6);
2395    }
2396
2397    @Override
2398    public void trace(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
2399            final Object p3, final Object p4, final Object p5, final Object p6, final Object p7) {
2400        logIfEnabled(FQCN, Level.TRACE, marker, message, p0, p1, p2, p3, p4, p5, p6, p7);
2401    }
2402
2403    @Override
2404    public void trace(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
2405            final Object p3, final Object p4, final Object p5,
2406            final Object p6, final Object p7, final Object p8) {
2407        logIfEnabled(FQCN, Level.TRACE, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8);
2408    }
2409
2410    @Override
2411    public void trace(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
2412            final Object p3, final Object p4, final Object p5,
2413            final Object p6, final Object p7, final Object p8, final Object p9) {
2414        logIfEnabled(FQCN, Level.TRACE, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
2415    }
2416
2417    @Override
2418    public void trace(final String message, final Object p0) {
2419        logIfEnabled(FQCN, Level.TRACE, null, message, p0);
2420    }
2421
2422    @Override
2423    public void trace(final String message, final Object p0, final Object p1) {
2424        logIfEnabled(FQCN, Level.TRACE, null, message, p0, p1);
2425    }
2426
2427    @Override
2428    public void trace(final String message, final Object p0, final Object p1, final Object p2) {
2429        logIfEnabled(FQCN, Level.TRACE, null, message, p0, p1, p2);
2430    }
2431
2432    @Override
2433    public void trace(final String message, final Object p0, final Object p1, final Object p2, final Object p3) {
2434        logIfEnabled(FQCN, Level.TRACE, null, message, p0, p1, p2, p3);
2435    }
2436
2437    @Override
2438    public void trace(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
2439            final Object p4) {
2440        logIfEnabled(FQCN, Level.TRACE, null, message, p0, p1, p2, p3, p4);
2441    }
2442
2443    @Override
2444    public void trace(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
2445            final Object p4, final Object p5) {
2446        logIfEnabled(FQCN, Level.TRACE, null, message, p0, p1, p2, p3, p4, p5);
2447    }
2448
2449    @Override
2450    public void trace(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
2451            final Object p4, final Object p5, final Object p6) {
2452        logIfEnabled(FQCN, Level.TRACE, null, message, p0, p1, p2, p3, p4, p5, p6);
2453    }
2454
2455    @Override
2456    public void trace(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
2457            final Object p4, final Object p5, final Object p6, final Object p7) {
2458        logIfEnabled(FQCN, Level.TRACE, null, message, p0, p1, p2, p3, p4, p5, p6, p7);
2459    }
2460
2461    @Override
2462    public void trace(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
2463            final Object p4, final Object p5, final Object p6, final Object p7, final Object p8) {
2464        logIfEnabled(FQCN, Level.TRACE, null, message, p0, p1, p2, p3, p4, p5, p6, p7, p8);
2465    }
2466
2467    @Override
2468    public void trace(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
2469            final Object p4, final Object p5, final Object p6, final Object p7, final Object p8, final Object p9) {
2470        logIfEnabled(FQCN, Level.TRACE, null, message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
2471    }
2472
2473    @Override
2474    public EntryMessage traceEntry() {
2475        return enter(FQCN, null, (Object[]) null);
2476    }
2477
2478    @Override
2479    public EntryMessage traceEntry(final String format, final Object... params) {
2480        return enter(FQCN, format, params);
2481    }
2482
2483    @Override
2484    public EntryMessage traceEntry(final Supplier<?>... paramSuppliers) {
2485        return enter(FQCN, null, paramSuppliers);
2486    }
2487
2488    @Override
2489    public EntryMessage traceEntry(final String format, final Supplier<?>... paramSuppliers) {
2490        return enter(FQCN, format, paramSuppliers);
2491    }
2492
2493    @Override
2494    public EntryMessage traceEntry(final Message message) {
2495        return enter(FQCN, message);
2496    }
2497
2498    @Override
2499    public void traceExit() {
2500        exit(FQCN, null, null);
2501    }
2502
2503    @Override
2504    public <R> R traceExit(final R result) {
2505        return exit(FQCN, null, result);
2506    }
2507
2508    @Override
2509    public <R> R traceExit(final String format, final R result) {
2510        return exit(FQCN, format, result);
2511    }
2512
2513    @Override
2514    public void traceExit(final EntryMessage message) {
2515        // If the message is null, traceEnter returned null because flow logging was disabled, we can optimize out calling isEnabled().
2516        if (message != null && isEnabled(Level.TRACE, EXIT_MARKER, message, null)) {
2517            logMessageSafely(FQCN, Level.TRACE, EXIT_MARKER, flowMessageFactory.newExitMessage(message), null);
2518        }
2519    }
2520
2521    @Override
2522    public <R> R traceExit(final EntryMessage message, final R result) {
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(result, message), null);
2526        }
2527        return result;
2528    }
2529
2530    @Override
2531    public <R> R traceExit(final Message message, final R result) {
2532        // If the message is null, traceEnter returned null because flow logging was disabled, we can optimize out calling isEnabled().
2533        if (message != null && isEnabled(Level.TRACE, EXIT_MARKER, message, null)) {
2534            logMessageSafely(FQCN, Level.TRACE, EXIT_MARKER, flowMessageFactory.newExitMessage(result, message), null);
2535        }
2536        return result;
2537    }
2538
2539    @Override
2540    public void warn(final Marker marker, final Message msg) {
2541        logIfEnabled(FQCN, Level.WARN, marker, msg, msg != null ? msg.getThrowable() : null);
2542    }
2543
2544    @Override
2545    public void warn(final Marker marker, final Message msg, final Throwable t) {
2546        logIfEnabled(FQCN, Level.WARN, marker, msg, t);
2547    }
2548
2549    @Override
2550    public void warn(final Marker marker, final CharSequence message) {
2551        logIfEnabled(FQCN, Level.WARN, marker, message, null);
2552    }
2553
2554    @Override
2555    public void warn(final Marker marker, final CharSequence message, final Throwable t) {
2556        logIfEnabled(FQCN, Level.WARN, marker, message, t);
2557    }
2558
2559    @Override
2560    public void warn(final Marker marker, final Object message) {
2561        logIfEnabled(FQCN, Level.WARN, marker, message, null);
2562    }
2563
2564    @Override
2565    public void warn(final Marker marker, final Object message, final Throwable t) {
2566        logIfEnabled(FQCN, Level.WARN, marker, message, t);
2567    }
2568
2569    @Override
2570    public void warn(final Marker marker, final String message) {
2571        logIfEnabled(FQCN, Level.WARN, marker, message, (Throwable) null);
2572    }
2573
2574    @Override
2575    public void warn(final Marker marker, final String message, final Object... params) {
2576        logIfEnabled(FQCN, Level.WARN, marker, message, params);
2577    }
2578
2579    @Override
2580    public void warn(final Marker marker, final String message, final Throwable t) {
2581        logIfEnabled(FQCN, Level.WARN, marker, message, t);
2582    }
2583
2584    @Override
2585    public void warn(final Message msg) {
2586        logIfEnabled(FQCN, Level.WARN, null, msg, msg != null ? msg.getThrowable() : null);
2587    }
2588
2589    @Override
2590    public void warn(final Message msg, final Throwable t) {
2591        logIfEnabled(FQCN, Level.WARN, null, msg, t);
2592    }
2593
2594    @Override
2595    public void warn(final CharSequence message) {
2596        logIfEnabled(FQCN, Level.WARN, null, message, null);
2597    }
2598
2599    @Override
2600    public void warn(final CharSequence message, final Throwable t) {
2601        logIfEnabled(FQCN, Level.WARN, null, message, t);
2602    }
2603
2604    @Override
2605    public void warn(final Object message) {
2606        logIfEnabled(FQCN, Level.WARN, null, message, null);
2607    }
2608
2609    @Override
2610    public void warn(final Object message, final Throwable t) {
2611        logIfEnabled(FQCN, Level.WARN, null, message, t);
2612    }
2613
2614    @Override
2615    public void warn(final String message) {
2616        logIfEnabled(FQCN, Level.WARN, null, message, (Throwable) null);
2617    }
2618
2619    @Override
2620    public void warn(final String message, final Object... params) {
2621        logIfEnabled(FQCN, Level.WARN, null, message, params);
2622    }
2623
2624    @Override
2625    public void warn(final String message, final Throwable t) {
2626        logIfEnabled(FQCN, Level.WARN, null, message, t);
2627    }
2628
2629    @Override
2630    public void warn(final Supplier<?> msgSupplier) {
2631        logIfEnabled(FQCN, Level.WARN, null, msgSupplier, (Throwable) null);
2632    }
2633
2634    @Override
2635    public void warn(final Supplier<?> msgSupplier, final Throwable t) {
2636        logIfEnabled(FQCN, Level.WARN, null, msgSupplier, t);
2637    }
2638
2639    @Override
2640    public void warn(final Marker marker, final Supplier<?> msgSupplier) {
2641        logIfEnabled(FQCN, Level.WARN, marker, msgSupplier, (Throwable) null);
2642    }
2643
2644    @Override
2645    public void warn(final Marker marker, final String message, final Supplier<?>... paramSuppliers) {
2646        logIfEnabled(FQCN, Level.WARN, marker, message, paramSuppliers);
2647    }
2648
2649    @Override
2650    public void warn(final Marker marker, final Supplier<?> msgSupplier, final Throwable t) {
2651        logIfEnabled(FQCN, Level.WARN, marker, msgSupplier, t);
2652    }
2653
2654    @Override
2655    public void warn(final String message, final Supplier<?>... paramSuppliers) {
2656        logIfEnabled(FQCN, Level.WARN, null, message, paramSuppliers);
2657    }
2658
2659    @Override
2660    public void warn(final Marker marker, final MessageSupplier msgSupplier) {
2661        logIfEnabled(FQCN, Level.WARN, marker, msgSupplier, (Throwable) null);
2662    }
2663
2664    @Override
2665    public void warn(final Marker marker, final MessageSupplier msgSupplier, final Throwable t) {
2666        logIfEnabled(FQCN, Level.WARN, marker, msgSupplier, t);
2667    }
2668
2669    @Override
2670    public void warn(final MessageSupplier msgSupplier) {
2671        logIfEnabled(FQCN, Level.WARN, null, msgSupplier, (Throwable) null);
2672    }
2673
2674    @Override
2675    public void warn(final MessageSupplier msgSupplier, final Throwable t) {
2676        logIfEnabled(FQCN, Level.WARN, null, msgSupplier, t);
2677    }
2678
2679    @Override
2680    public void warn(final Marker marker, final String message, final Object p0) {
2681        logIfEnabled(FQCN, Level.WARN, marker, message, p0);
2682    }
2683
2684    @Override
2685    public void warn(final Marker marker, final String message, final Object p0, final Object p1) {
2686        logIfEnabled(FQCN, Level.WARN, marker, message, p0, p1);
2687    }
2688
2689    @Override
2690    public void warn(final Marker marker, final String message, final Object p0, final Object p1, final Object p2) {
2691        logIfEnabled(FQCN, Level.WARN, marker, message, p0, p1, p2);
2692    }
2693
2694    @Override
2695    public void warn(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
2696            final Object p3) {
2697        logIfEnabled(FQCN, Level.WARN, marker, message, p0, p1, p2, p3);
2698    }
2699
2700    @Override
2701    public void warn(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
2702            final Object p3, final Object p4) {
2703        logIfEnabled(FQCN, Level.WARN, marker, message, p0, p1, p2, p3, p4);
2704    }
2705
2706    @Override
2707    public void warn(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
2708            final Object p3, final Object p4, final Object p5) {
2709        logIfEnabled(FQCN, Level.WARN, marker, message, p0, p1, p2, p3, p4, p5);
2710    }
2711
2712    @Override
2713    public void warn(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
2714            final Object p3, final Object p4, final Object p5, final Object p6) {
2715        logIfEnabled(FQCN, Level.WARN, marker, message, p0, p1, p2, p3, p4, p5, p6);
2716    }
2717
2718    @Override
2719    public void warn(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
2720            final Object p3, final Object p4, final Object p5, final Object p6, final Object p7) {
2721        logIfEnabled(FQCN, Level.WARN, marker, message, p0, p1, p2, p3, p4, p5, p6, p7);
2722    }
2723
2724    @Override
2725    public void warn(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
2726            final Object p3, final Object p4, final Object p5, final Object p6, final Object p7, final Object p8) {
2727        logIfEnabled(FQCN, Level.WARN, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8);
2728    }
2729
2730    @Override
2731    public void warn(final Marker marker, final String message, final Object p0, final Object p1, final Object p2,
2732            final Object p3, final Object p4, final Object p5,
2733            final Object p6, final Object p7, final Object p8, final Object p9) {
2734        logIfEnabled(FQCN, Level.WARN, marker, message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
2735    }
2736
2737    @Override
2738    public void warn(final String message, final Object p0) {
2739        logIfEnabled(FQCN, Level.WARN, null, message, p0);
2740    }
2741
2742    @Override
2743    public void warn(final String message, final Object p0, final Object p1) {
2744        logIfEnabled(FQCN, Level.WARN, null, message, p0, p1);
2745    }
2746
2747    @Override
2748    public void warn(final String message, final Object p0, final Object p1, final Object p2) {
2749        logIfEnabled(FQCN, Level.WARN, null, message, p0, p1, p2);
2750    }
2751
2752    @Override
2753    public void warn(final String message, final Object p0, final Object p1, final Object p2, final Object p3) {
2754        logIfEnabled(FQCN, Level.WARN, null, message, p0, p1, p2, p3);
2755    }
2756
2757    @Override
2758    public void warn(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
2759            final Object p4) {
2760        logIfEnabled(FQCN, Level.WARN, null, message, p0, p1, p2, p3, p4);
2761    }
2762
2763    @Override
2764    public void warn(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
2765            final Object p4, final Object p5) {
2766        logIfEnabled(FQCN, Level.WARN, null, message, p0, p1, p2, p3, p4, p5);
2767    }
2768
2769    @Override
2770    public void warn(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
2771            final Object p4, final Object p5, final Object p6) {
2772        logIfEnabled(FQCN, Level.WARN, null, message, p0, p1, p2, p3, p4, p5, p6);
2773    }
2774
2775    @Override
2776    public void warn(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
2777            final Object p4, final Object p5, final Object p6, final Object p7) {
2778        logIfEnabled(FQCN, Level.WARN, null, message, p0, p1, p2, p3, p4, p5, p6, p7);
2779    }
2780
2781    @Override
2782    public void warn(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
2783            final Object p4, final Object p5, final Object p6, final Object p7, final Object p8) {
2784        logIfEnabled(FQCN, Level.WARN, null, message, p0, p1, p2, p3, p4, p5, p6, p7, p8);
2785    }
2786
2787    @Override
2788    public void warn(final String message, final Object p0, final Object p1, final Object p2, final Object p3,
2789            final Object p4, final Object p5, final Object p6,
2790            final Object p7, final Object p8, final Object p9) {
2791        logIfEnabled(FQCN, Level.WARN, null, message, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
2792    }
2793}