zoukankan      html  css  js  c++  java
  • HttpClient系统日志配置

    详细介绍在:http://hc.apache.org/httpclient-3.x/logging.html

    一般使用context logging基本够用,context logging解释原文如下:

    context logging

    Context logging contains information about the internal operation of HttpClient as it performs HTTP requests. Each class has its own log named according to the class's fully qualified name. For example the class HttpClient has a log named org.apache.commons.httpclient.HttpClient. Since all classes follow this convention it is possible to configure context logging for all classes using the single log named org.apache.commons.httpclient.

    Example

    Commons Logging comes with a basic logger called SimpleLog. This logger writes all logged messages to System.err. The following examples show how to configure Commons Logging via system properties to use SimpleLog.

    配置代码如下:

    System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.SimpleLog");
    
    System.setProperty("org.apache.commons.logging.simplelog.showdatetime", "true");
    
    System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.commons.httpclient", "debug");// "stdout"为标准输出格式,"debug"为调试模式
    

  • 相关阅读:
    HBase 列族数量为什么越少越好
    Hbase 认识及其作用
    Hbase 源码讲解
    Hbase 目录树
    rabbitmq 连接过程详解
    rabbit 兔子和兔子窝
    rabbit 函数参数详解
    rabbitmq 用户和授权
    火狐浏览器安装有道插件
    rabbitmq vhost
  • 原文地址:https://www.cnblogs.com/archermeng/p/7537210.html
Copyright © 2011-2022 走看看