• 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"为调试模式
    

  • 相关阅读:
    二叉排序树
    堆排序
    线索化二叉树
    vue 格式化代码
    线程的理解
    声明式的服务调用 Feign
    使用锁 的理解
    zookeeper 的理解
    AQS 源码解析
    HashMap 的理解与结构
  • 原文地址:https://www.cnblogs.com/archermeng/p/7537209.html
Copyright © 2020-2023  润新知