All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.infinispan.util.logging.LogFactory Maven / Gradle / Ivy

There is a newer version: 9.1.7.Final
Show newest version
package org.infinispan.util.logging;

import org.jboss.logging.Logger;
import org.jboss.logging.NDC;

/**
 * Factory that creates {@link Log} instances.
 *
 * @author Manik Surtani
 * @since 4.0
 */
public class LogFactory {
   public static final String LOG_ROOT = "org.infinispan.";

   public static Log CLUSTER = Logger.getMessageLogger(Log.class, LOG_ROOT + "CLUSTER");

   public static Log getLog(Class clazz) {
      return Logger.getMessageLogger(Log.class, clazz.getName());
   }

   public static  T getLog(Class clazz, Class logClass) {
      return Logger.getMessageLogger(logClass, clazz.getName());
   }

   public static Logger getLogger(String category) {
      return Logger.getLogger(LOG_ROOT + category);
   }

   public static void pushNDC(String cacheName, boolean isTrace) {
      if (isTrace)
         NDC.push(cacheName);
   }

   public static void popNDC(boolean isTrace) {
      if (isTrace)
         NDC.pop();
   }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy