org.objectweb.jonas.common.Log类的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(6.8k)|赞(0)|评价(0)|浏览(64)

本文整理了Java中org.objectweb.jonas.common.Log类的一些代码示例,展示了Log类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Log类的具体详情如下:
包路径:org.objectweb.jonas.common.Log
类名称:Log

Log介绍

[英]This class provides utility method for using Monolog
[中]此类提供了使用Monolog的实用方法

代码示例

代码示例来源:origin: org.objectweb.jonas/jonas-naming

/**
 * Constructor.
 * @param id id of the context.
 */
public ComponentContext(String id) {
  myEnv = new Hashtable();
  compId = id;
  logger = Log.getLogger(Log.JONAS_NAMING_PREFIX);
}

代码示例来源:origin: org.objectweb.jonas/jonas-commons

/**
 * Returns the standard PrintWriter associated to the logger defined by
 * its topic.
 * This is mainly used for DBM and Connectors.
 */
public static PrintWriter getLogWriter(String topic) {
  // TODO : should not create a new object at each call
  return new PrintWriterImpl(getLogger(topic), getLoggerFactory());
}

代码示例来源:origin: org.objectweb.jonas/jonas-naming

/**
 * Remove the ComponentContext associated with the given classloader.
 * @param cl the classloader which is bind to the context.
 */
public void unSetComponentContext(ClassLoader cl) {
  if (Log.isDebugNaming()) {
    logger.log(BasicLevel.DEBUG, "class loader = " + cl);
  }
  clBindings.remove(cl);
}

代码示例来源:origin: org.objectweb.jonas/jonas-client

/**
 * Call the Log class to instanciate the client container logger
 */
private void initLogger() {
  // Allow tracing ejb/jms code
  Log.configure(clientTraceFile);
  // init the logger
  this.logger = Log.getLogger(Log.JONAS_CLIENT_PREFIX);
}

代码示例来源:origin: org.objectweb.jonas/jonas-log

/**
 * @return list of properties for logging system
 */
public Properties getProperties() {
  Properties props = Log.getProperties();
  if (props == null) {
    Log.getLoggerFactory();
    props = Log.getProperties();
  }
  return props;
}

代码示例来源:origin: org.objectweb.jonas/jonas-commons

/**
 * Shortcut that returns the LevelFactory
 */
public static LevelFactory getLevelFactory() {
  return (LevelFactory) getLoggerFactory();
}

代码示例来源:origin: org.objectweb.jonas/jonas-log

/**
 * set Topic Level
 * @param topic topic to set
 * @param level the level to set
 */
public void setTopicLevel(final String topic, final String level) {
  Logger topicLogger = Log.getLoggerFactory().getLogger(topic);
  Level lev = Log.getLevelFactory().getLevel(level);
  // must check null (bug monolog)
  if (lev != null) {
    topicLogger.setLevel(lev);
  } else {
    // TO DO maybe a better error treatement could be found
    throw new RuntimeException("Unknown level " + level);
  }
  // the modified property name is 'logger.topic.level'
  String propName = "logger." + topic + ".level";
  // Send a notification containing the new value of this property to the
  // listner MBean
  sendReconfigNotification(++sequenceNumber, SERVICE_NAME, new PropertiesConfigurationData(propName, level));
}

代码示例来源:origin: org.objectweb.jonas/jonas-commons

/**
 * Configure Logger
 * @param file The configuration file for monolog (usually: trace.properties)
 */
public static void configure(String file) {
  configFile = file;
  getLoggerFactory();
  if (!clientcontainer) {
    P6SpyLogger.logger = lf.getLogger(SPY_LOGGER_NAME);
    // Comment out call until JONAS uses Log4j
    // TraceTm.configure(lf);
  }
}

代码示例来源:origin: org.objectweb.jonas/jonas-naming

/**
 * Constructor.
 * @param id id of the context.
 * @param env initial environment.
 */
public ComponentContext(String id, Hashtable env) {
  if (env != null) {
    // clone env to be able to change it.
    myEnv = (Hashtable) (env.clone());
  }
  compId = id;
  logger = Log.getLogger(Log.JONAS_NAMING_PREFIX);
}

代码示例来源:origin: org.objectweb.jonas/jonas-ejb-2.1

servlog = Log.getLogger(Log.JONAS_SERVER_PREFIX);
loaderlog = Log.getLogger(Log.JONAS_LOADER_PREFIX);
TraceTimer.configure(Log.getLoggerFactory());
TraceEjb.configure(Log.getLoggerFactory());

代码示例来源:origin: org.objectweb.jonas/jonas-commons

/**
 * Shortcut to get the Logger by its topic name.
 * @param topic the topic of the returned logger
 * @return always a logger instance (never null value).
 */
public static Logger getLogger(String topic) {
  return getLoggerFactory().getLogger(topic);
}

代码示例来源:origin: org.objectweb.jonas/jonas-naming

/**
 * Associate the specified ComponentContext with the given classloader.
 * @param ctx the context to associate to the classloader.
 * @param cl the classloader which is bind to the context.
 */
public void setComponentContext(Context ctx, ClassLoader cl) {
  if (Log.isDebugNaming()) {
    logger.log(BasicLevel.DEBUG, "class loader = " + cl);
  }
  clBindings.put(cl, ctx);
}

代码示例来源:origin: org.objectweb.jonas/jonas-commons

/**
   * Sets booleans which enable debugging (debug level or Warn)
   */
  public static void syncLevels() {
    // debug
    isDebugNaming = getLogger(JONAS_NAMING_PREFIX).isLoggable(BasicLevel.DEBUG);
  }
}

代码示例来源:origin: org.objectweb.jonas/jonas-log

/**
 * @return the topics list. Assumes that all Loggers are TopicalLoggers.
 */
public String[] getTopics() {
  Logger[] logs = Log.getLoggerFactory().getLoggers();
  // put names in alphabetical order
  TreeSet tset = new TreeSet();
  for (int i = 0; i < logs.length; i++) {
    tset.add(logs[i].getName());
  }
  return (String[]) tset.toArray(new String[0]);
}

代码示例来源:origin: org.objectweb.jonas/jonas-naming

/**
 * Set the context used by client container (per JVM instead of per thread)
 * @param ctx the context to set
 */
public void setClientContainerComponentContext(Context ctx) {
  if (Log.isDebugNaming()) {
    logger.log(BasicLevel.DEBUG, "");
  }
  clientCtx = ctx;
}

代码示例来源:origin: org.objectweb.jonas/jonas-jca-scout-glue

/**
 * Display Info log at JAXR Connector start.
 * @see javax.resource.spi.ResourceAdapter#start(javax.resource.spi.BootstrapContext)
 */
public void start(BootstrapContext bCtx) throws ResourceAdapterInternalException {
  logger = Log.getLogger(Log.JONAS_JAXR_PREFIX);
  logger.log(BasicLevel.INFO, "Starting Scout ResourceAdapter");
}

代码示例来源:origin: org.objectweb.jonas/jonas-log

/**
 * Returns the names of the Monolog handlers
 * @return The handler names defines in Monolog
 */
public String[] getHandlerNames() {
  LoggerFactory lf = Log.getLoggerFactory();
  if (lf instanceof HandlerFactory) {
    HandlerFactory mf = (HandlerFactory) lf;
    Handler[] hs = mf.getHandlers();
    String[] hns = new String[hs.length];
    for (int i = 0; i < hs.length; i++) {
      hns[i] = hs[i].getName();
    }
    return hns;
  }
  return null;
}

代码示例来源:origin: org.objectweb.jonas/jonas-naming

/**
 * Return the ComponentContext associated with the given classloader.
 * @param cl the classloader which is bind to the context.
 * @return the ComponentContext associated with the given classloader.
 */
public Context getComponentContext(ClassLoader cl) {
  if (Log.isDebugNaming()) {
    logger.log(BasicLevel.DEBUG, "class loader = " + cl);
  }
  return (Context) clBindings.get(cl);
}

代码示例来源:origin: org.objectweb.jonas/jonas-dbm

/**
 * @param s Jndi name for the datasource
 */
public void setDSName(String s) {
  dSName = s;
  logger = Log.getLogger(Log.JONAS_DBM_PREFIX + "." + dSName);
  // Start a thread to manage the pool of connections
  poolKeeper = new PoolMonitor(this, logger);
  poolKeeper.start();
  // Add it to the list
  cmList.put(s, this);
}

代码示例来源:origin: org.objectweb.jonas/jonas-log

/**
 * Getter for the map of the attributes of a handler.
 * @param handlername the handler name
 * @return The map of the attributes defines for the handler
 */
public Map getHandlerAttributes(final String handlername) {
  LoggerFactory lf = Log.getLoggerFactory();
  if (lf instanceof HandlerFactory) {
    HandlerFactory mf = (HandlerFactory) lf;
    Handler h = mf.getHandler(handlername);
    String[] ans = h.getAttributeNames();
    Map m = new HashMap(ans.length);
    for (int i = 0; i < ans.length; i++) {
      m.put(ans[i], h.getAttribute(ans[i]));
    }
    return m;
  }
  return null;
}

相关文章

微信公众号

最新文章

更多