com.jfinal.log.Log类的使用及代码示例

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

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

Log介绍

[英]The five logging levels used by Log are (in order): 1. DEBUG (the least serious) 2. INFO 3. WARN 4. ERROR 5. FATAL (the most serious)
[中]Log使用的五个日志记录级别是(按顺序):1。调试(最不严重的)2。信息3。警告4。错误5。致命(最严重)

代码示例

代码示例来源:origin: jfinal/jfinal

public static void error(String message) {
  Holder.log.error(message);
}

代码示例来源:origin: jfinal/jfinal

if (log.isWarnEnabled()) {
  String qs = request.getQueryString();
  msg = msg + (qs == null ? target : target + "?" + qs);
    msg = msg + "\n" + e.getMessage();
  log.warn(msg);
if (log.isErrorEnabled()) {
  String qs = request.getQueryString();
  log.error(errorCode + " Error: " + (qs == null ? target : target + "?" + qs), e);

代码示例来源:origin: jfinal/jfinal

static Cache getOrAddCache(String cacheName) {
  Cache cache = cacheManager.getCache(cacheName);
  if (cache == null) {
    synchronized(CacheKit.class) {
      cache = cacheManager.getCache(cacheName);
      if (cache == null) {
        log.warn("Could not find cache config [" + cacheName + "], using default.");
        cacheManager.addCacheIfAbsent(cacheName);
        cache = cacheManager.getCache(cacheName);
        log.debug("Cache [" + cacheName + "] started.");
      }
    }
  }
  return cache;
}

代码示例来源:origin: jfinal/jfinal

public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
  HttpServletRequest request = (HttpServletRequest)req;
  HttpServletResponse response = (HttpServletResponse)res;
  request.setCharacterEncoding(encoding);
  
  String target = request.getRequestURI();
  if (contextPathLength != 0) {
    target = target.substring(contextPathLength);
  }
  
  boolean[] isHandled = {false};
  try {
    handler.handle(target, request, response, isHandled);
  }
  catch (Exception e) {
    if (log.isErrorEnabled()) {
      String qs = request.getQueryString();
      log.error(qs == null ? target : target + "?" + qs, e);
    }
  }
  
  if (isHandled[0] == false) {
    chain.doFilter(request, response);
  }
}

代码示例来源:origin: jfinal/jfinal

public static void warn(String message, Throwable t) {
  Holder.log.warn(message, t);
}

代码示例来源:origin: yangfuhai/jboot

@Override
  public void run() {
    while (true) {
      //订阅线程断开连接,需要进行重连
      try {
        jedisCluster.subscribe(listener, channels);
        LOG.warn("Disconnect to redis channel in subscribe JedisPubSub!");
        break;
      } catch (JedisConnectionException e) {
        LOG.error("failed connect to redis, reconnect it.", e);
        try {
          Thread.sleep(1000);
        } catch (InterruptedException ie) {
          break;
        }
      }
    }
  }
}.start();

代码示例来源:origin: com.jfinal/jfinal-weixin

if (log.isDebugEnabled()) {
  log.debug("wxaapp pushOrder xmlResult:" + xmlResult);
String return_msg = result.get("return_msg");
if (StrKit.isBlank(return_code) || !"SUCCESS".equals(return_code)) {
  log.error(return_msg);
  throw new PaymentException(return_code, return_msg);
  log.error(return_msg);
  throw new PaymentException(return_code, return_msg);

代码示例来源:origin: yangfuhai/jboot

/**
 * 获取单例
 *
 * @param clazz
 * @param <T>
 * @return
 */
public static <T> T singleton(Class<T> clazz) {
  Object object = singletons.get(clazz);
  if (object == null) {
    synchronized (clazz) {
      object = singletons.get(clazz);
      if (object == null) {
        object = newInstance(clazz);
        if (object != null) {
          singletons.put(clazz, object);
        } else {
          Log.getLog(clazz).error("cannot new newInstance!!!!");
        }
      }
    }
  }
  return (T) object;
}

代码示例来源:origin: jfinal/jfinal

public static void debug(String message) {
  Holder.log.debug(message);
}

代码示例来源:origin: jfinal/jfinal

/**
 * 当通过 Constants.setLogFactory(...) 或者 
 * LogManager.me().setDefaultLogFacotyr(...)
 * 指定默认日志工厂以后,重置一下内部 Log 对象,以便使内部日志实现与系统保持一致
 */
public static void synchronizeLog() {
  Holder.log = Log.getLog(LogKit.class);
}

代码示例来源:origin: jfinal/jfinal

public static boolean isDebugEnabled() {
  return Holder.log.isDebugEnabled();
}

代码示例来源:origin: jfinal/jfinal

public static boolean isErrorEnabled() {
  return Holder.log.isErrorEnabled();
}

代码示例来源:origin: jfinal/jfinal

public static boolean isWarnEnabled() {
  return Holder.log.isWarnEnabled();
}

代码示例来源:origin: jfinal/jfinal

public static void warn(String message) {
  Holder.log.warn(message);
}

代码示例来源:origin: yangfuhai/jboot

@Override
  public void run() {
    while (true) {
      //订阅线程断开连接,需要进行重连
      try {
        jedisCluster.subscribe(binaryListener, channels);
        LOG.warn("Disconnect to redis channel in subscribe BinaryJedisPubSub!");
        break;
      } catch (JedisConnectionException e) {
        LOG.error("failed connect to redis, reconnect it.", e);
        try {
          Thread.sleep(1000);
        } catch (InterruptedException ie) {
          break;
        }
      }
    }
  }
}.start();

代码示例来源:origin: com.jfinal/jfinal

public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
  HttpServletRequest request = (HttpServletRequest)req;
  HttpServletResponse response = (HttpServletResponse)res;
  request.setCharacterEncoding(encoding);
  
  String target = request.getRequestURI();
  if (contextPathLength != 0) {
    target = target.substring(contextPathLength);
  }
  
  boolean[] isHandled = {false};
  try {
    handler.handle(target, request, response, isHandled);
  }
  catch (Exception e) {
    if (log.isErrorEnabled()) {
      String qs = request.getQueryString();
      log.error(qs == null ? target : target + "?" + qs, e);
    }
  }
  
  if (isHandled[0] == false) {
    chain.doFilter(request, response);
  }
}

代码示例来源:origin: jfinal/jfinal

public static void debug(String message, Throwable t) {
  Holder.log.debug(message, t);
}

代码示例来源:origin: jfinal/jfinal

static void initLog() {
    log = Log.getLog(JFinalFilter.class);
  }
}

代码示例来源:origin: com.jfinal/jfinal

public static boolean isDebugEnabled() {
  return Holder.log.isDebugEnabled();
}

代码示例来源:origin: com.jfinal/jfinal

public static boolean isErrorEnabled() {
  return Holder.log.isErrorEnabled();
}

相关文章