Package org.apache.logging.log4j.message

Examples of org.apache.logging.log4j.message.MessageFactory


     * @param messageFactory
     *            The message factory to check.
     */
    public static void checkMessageFactory(final Logger logger, final MessageFactory messageFactory) {
        final String name = logger.getName();
        final MessageFactory loggerMessageFactory = logger.getMessageFactory();
        if (messageFactory != null && !loggerMessageFactory.equals(messageFactory)) {
            StatusLogger
                .getLogger()
                .warn("The Logger {} was created with the message factory {} and is now requested with the " +
                    "message factory {}, which may create log events with unexpected formatting.",
                    name, loggerMessageFactory, messageFactory);
        } else if (messageFactory == null
            && !loggerMessageFactory.getClass().equals(DEFAULT_MESSAGE_FACTORY_CLASS)) {
            StatusLogger
                .getLogger()
                .warn("The Logger {} was created with the message factory {} and is now requested with a null " +
                    "message factory (defaults to {}), which may create log events with unexpected formatting.",
                    name, loggerMessageFactory, DEFAULT_MESSAGE_FACTORY_CLASS.getName());
View Full Code Here


     * @param messageFactory
     *            The message factory to check.
     */
    public static void checkMessageFactory(final Logger logger, final MessageFactory messageFactory) {
        final String name = logger.getName();
        final MessageFactory loggerMessageFactory = logger.getMessageFactory();
        if (messageFactory != null && !loggerMessageFactory.equals(messageFactory)) {
            StatusLogger
                    .getLogger()
                    .warn("The Logger {} was created with the message factory {} and is now requested with the " +
                        "message factory {}, which may create log events with unexpected formatting.",
                            name, loggerMessageFactory, messageFactory);
        } else if (messageFactory == null
                && !loggerMessageFactory.getClass().equals(DEFAULT_MESSAGE_FACTORY_CLASS)) {
            StatusLogger
                    .getLogger()
                    .warn("The Logger {} was created with the message factory {} and is now requested with a null " +
                        "message factory (defaults to {}), which may create log events with unexpected formatting.",
                            name, loggerMessageFactory, DEFAULT_MESSAGE_FACTORY_CLASS.getName());
View Full Code Here

     * @param messageFactory
     *            The message factory to check.
     */
    public static void checkMessageFactory(final Logger logger, final MessageFactory messageFactory) {
        final String name = logger.getName();
        final MessageFactory loggerMessageFactory = logger.getMessageFactory();
        if (messageFactory != null && !loggerMessageFactory.equals(messageFactory)) {
            StatusLogger
                .getLogger()
                .warn("The Logger {} was created with the message factory {} and is now requested with the " +
                    "message factory {}, which may create log events with unexpected formatting.",
                    name, loggerMessageFactory, messageFactory);
        } else if (messageFactory == null
            && !loggerMessageFactory.getClass().equals(DEFAULT_MESSAGE_FACTORY_CLASS)) {
            StatusLogger
                .getLogger()
                .warn("The Logger {} was created with the message factory {} and is now requested with a null " +
                    "message factory (defaults to {}), which may create log events with unexpected formatting.",
                    name, loggerMessageFactory, DEFAULT_MESSAGE_FACTORY_CLASS.getName());
View Full Code Here

TOP

Related Classes of org.apache.logging.log4j.message.MessageFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.