Tabnine Logo
LogFactory
Code IndexAdd Tabnine to your IDE (free)

How to use
LogFactory
in
de.mhus.lib.core.logging

Best Java code snippets using de.mhus.lib.core.logging.LogFactory (Showing top 16 results out of 315)

origin: de.mhus.lib/mhu-lib-core

public static boolean isTrailLevelMapper() {
  IApi api = MApi.get();
  LevelMapper mapper = api.getLogFactory().getLevelMapper();
  return (mapper != null && mapper instanceof TrailLevelMapper);
}

origin: de.mhus.lib/mhu-lib-core

/**
 * <p>Construct (if necessary) and return a <code>Log</code> instance,
 * using the factory's current set of configuration attributes.</p>
 *
 * <p><strong>NOTE</strong> - Depending upon the implementation of
 * the <code>LogFactory</code> you are using, the <code>Log</code>
 * instance you are returned may or may not be local to the current
 * application, and may or may not be returned again on a subsequent
 * call with the same name argument.</p>
 *
 * @param name Logical name of the <code>Log</code> instance to be
 *  returned (the meaning of this name is only known to the underlying
 *  logging implementation that is being wrapped)
 * @return  the log engine
 */
public synchronized LogEngine getInstance(String name) {
  LogEngine inst = buffer.get(name);
  if (inst == null) {
    inst = createInstance(name);
    inst.doInitialize(this);
    buffer.put(name,inst);
  }
  return inst;
}
origin: de.mhus.lib/mhu-lib-core

public LogEngine getLog(Class<?> class1) {
  return getInstance(class1);
}
origin: de.mhus.lib/mhu-lib-karaf

} break;
case "list": {
  System.out.println("Default Level  : " + api.getLogFactory().getDefaultLevel());
  System.out.println("Trace          : " + api.isFullTrace());
  System.out.println("LogFoctory     : " + api.getLogFactory().getClass().getSimpleName());
  System.out.println("DirtyTrace     : " + MApi.isDirtyTrace());
  LevelMapper lm = api.getLogFactory().getLevelMapper();
  if (lm != null) {
  System.out.println("LevelMapper    : " + lm.getClass().getSimpleName());
  if (api.getLogFactory().getParameterMapper() != null)
  System.out.println("ParameterMapper: " + api.getLogFactory().getParameterMapper().getClass().getSimpleName());
} break;
case "level": {
  api.getLogFactory().setDefaultLevel(Log.LEVEL.valueOf(parameters[0].toUpperCase()));
  MApi.updateLoggers();
  System.out.println("OK");
} break;
case "settrail": {
  LevelMapper mapper = api.getLogFactory().getLevelMapper();
  if (MLogUtil.isTrailLevelMapper()) {
    MLogUtil.setTrailConfig(parameters == null || parameters.length < 1 ? "" : parameters[0]);
  LevelMapper mapper = api.getLogFactory().getLevelMapper();
  if (MLogUtil.isTrailLevelMapper()) {
    System.out.println("LevelMapper: " + MLogUtil.getTrailConfig());
  LevelMapper mapper = api.getLogFactory().getLevelMapper();
origin: de.mhus.lib/mhu-lib-core

public void update() {
  engine = MApi.get().getLogFactory().getInstance(getName());
  localTrace = MApi.isTrace(name);
  levelMapper = MApi.get().getLogFactory().getLevelMapper();
  parameterMapper = MApi.get().getLogFactory().getParameterMapper();
  maxMsgSize = MApi.get().getLogFactory().getMaxMessageSize();
}
origin: de.mhus.lib/mhu-lib-core

  if (MString.isEmpty(name)) name = System.getProperty(MConstants.PROP_PREFIX + key);
  if (MString.isSet(name)) {
    logFactory.setLevelMapper( (LevelMapper) Class.forName(name.trim()).newInstance() );
  String size = system.getString(key);
  if (size != null) {
    logFactory.setMaxMessageSize(Integer.valueOf(size));
  if (MString.isEmpty(name)) name = System.getProperty(MConstants.PROP_PREFIX + key);
  if (MString.isSet(name)) {
    logFactory.setParameterMapper( (ParameterMapper) Class.forName(name.trim()).newInstance() );
if (logFactory.getParameterMapper() != null && logFactory.getParameterMapper() instanceof MutableParameterMapper) {
  try {
    Collection<IConfig> mappers = system.getNodes(MConstants.PROP_LOG_PARAMETER_MAPPER_CLASS);
    if (mappers.size() > 0) ((MutableParameterMapper)logFactory.getParameterMapper()).clear();
    for (IConfig mapper : mappers) {
      String name = mapper.getString("name");
      String clazz = mapper.getString("class");
      if (MString.isSet(name) && MString.isSet(clazz))
        ((MutableParameterMapper)logFactory.getParameterMapper()).put(name, (ParameterEntryMapper) Class.forName(clazz.trim()).newInstance() );
  if (MString.isEmpty(value)) value = System.getProperty(MConstants.PROP_PREFIX + key);
  if (MString.isSet(value)) {
    logFactory.setDefaultLevel(Log.LEVEL.valueOf(value.toUpperCase()));
origin: de.mhus.lib/mhu-lib-core

public static void releaseTrailConfig() {
  IApi api = MApi.get();
  LevelMapper mapper = api.getLogFactory().getLevelMapper();
  if (mapper != null && mapper instanceof TrailLevelMapper) {
    TrailLevelMapper m = (TrailLevelMapper)mapper;
    m.doResetTrail();
  }
}
origin: de.mhus.lib/mhu-lib-core

/**
 * Convenience method to derive a name from the specified class and
 * call <code>getInstance(String)</code> with it.
 *
 * @param clazz Class for which a suitable Log name will be derived
 * @return The current log engine
 *     */
public LogEngine getInstance(Class<?> clazz) {
  return getInstance(clazz.getCanonicalName());
}
origin: de.mhus.lib/mhu-lib-core

  public static void setTrailConfig(String parameters) {
    IApi api = MApi.get();
    LevelMapper mapper = api.getLogFactory().getLevelMapper();
    if (mapper != null && mapper instanceof TrailLevelMapper) {
      TrailLevelMapper m = (TrailLevelMapper)mapper;
//            ThreadMapperConfig config = new ThreadMapperConfig();
//            if (parameters != null) {
//                config.doConfigure(parameters);
//            }
      m.doConfigureTrail(parameters);
    }
  }

origin: de.mhus.lib/mhu-lib-core

public static String getTrailConfig() {
  IApi api = MApi.get();
  LevelMapper mapper = api.getLogFactory().getLevelMapper();
  if (mapper != null && mapper instanceof TrailLevelMapper) {
    TrailLevelMapper m = (TrailLevelMapper)mapper;
    return m.doSerializeTrail();
  }
  return null;
}
origin: de.mhus.lib/mhu-lib-core

public static void doStartTrailLog() {
  LevelMapper mapper = get().getLogFactory().getLevelMapper();
  if (mapper != null && mapper instanceof TrailLevelMapper)
    ((TrailLevelMapper)mapper).doConfigureTrail("MAP");
}

origin: de.mhus.lib/mhu-lib-core

public static void doStopTrailLog() {
  LevelMapper mapper = get().getLogFactory().getLevelMapper();
  if (mapper != null && mapper instanceof TrailLevelMapper)
    ((TrailLevelMapper)mapper).doResetTrail();
}
origin: de.mhus.lib/mhu-lib-core

public static void resetAllTrailConfigs() {
  IApi api = MApi.get();
  LevelMapper mapper = api.getLogFactory().getLevelMapper();
  if (mapper != null && mapper instanceof TrailLevelMapper) {
    TrailLevelMapper m = (TrailLevelMapper)mapper;
    m.doResetAllTrails();
  }
}

origin: de.mhus.lib/mhu-lib-core

public TimerTaskWrap(TimerImpl timer,String name, TimerTask task) {
  this.task = task;
  this.timer = timer;
  if (name == null) name = MSystem.getClassName(task);
  this.name = name;
  synchronized (timer) {
    timer.tasks.add(this);
  }
  LevelMapper lm = MApi.get().getLogFactory().getLevelMapper();
  if (lm != null && lm instanceof TrailLevelMapper)
    log = ((TrailLevelMapper)lm).doSerializeTrail();
}
@Override
origin: de.mhus.lib/mhu-lib-core

    LevelMapper lm = MApi.get().getLogFactory().getLevelMapper();
    if (lm != null && lm instanceof TrailLevelMapper)
      ((TrailLevelMapper)lm).doConfigureTrail(log);
} finally {
  if (log != null) {
    LevelMapper lm = MApi.get().getLogFactory().getLevelMapper();
    if (lm != null && lm instanceof TrailLevelMapper)
      ((TrailLevelMapper)lm).doResetTrail();
origin: de.mhus.lib/mhu-lib-jms

LevelMapper levelMapper = MApi.get().getLogFactory().getLevelMapper();
if (levelMapper != null && levelMapper instanceof TrailLevelMapper)
  ((TrailLevelMapper)levelMapper).doResetTrail();
de.mhus.lib.core.loggingLogFactory

Most used methods

  • getLevelMapper
  • getMaxMessageSize
  • getParameterMapper
  • setDefaultLevel
  • setLevelMapper
  • setMaxMessageSize
  • createInstance
    Construct and return a Log instance, using the factory's current set of configuration attributes. N
  • getDefaultLevel
  • getInstance
    Construct (if necessary) and return a Log instance, using the factory's current set of configuration
  • init
  • setParameterMapper
  • setParameterMapper

Popular in Java

  • Making http requests using okhttp
  • startActivity (Activity)
  • onCreateOptionsMenu (Activity)
  • setRequestProperty (URLConnection)
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • JButton (javax.swing)
  • Table (org.hibernate.mapping)
    A relational table
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now