V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Eliefly
V2EX  ›  Java

[求助] Java 普通命令行程序怎么关掉 DEBUG 打印

  •  
  •   Eliefly · 2018-04-26 18:05:59 +08:00 · 3621 次点击
    这是一个创建于 2189 天前的主题,其中的信息可能已经有所发展或是发生改变。

    一个普通的 java 命令行执行程序,会使用 httpcliet 推送东西,然后终端满屏的 DEBUG 打印,包括传输的数据。 求助下怎么关掉这些打印。

    17:55:37.785 [main] DEBUG org.apache.http.wire - http-outgoing-2 >> "[\r][\n]"
    17:55:37.785 [main] DEBUG org.apache.http.wire - http-outgoing-2 >> "[0xb6][0xd4][0xd3][0xda][0xb7][0xa2][0xcb][0xcd][0xcf][0xfb][0xcf][0xa2][0xa3][0xba][0xce][0xd2][0xc3][0xc7][0xd2][0xbb][0xb0][0xe3][0xbf][0xc9][0xd2][0xd4][0xca][0xb9][0xd3][0xc3] RabbitTemplate[0xa3][0xac][0xd5][0xe2][0xb8][0xf6][0xca][0xc7] Spring [0xb7][0xe2][0xd7][0xb0][0xb8][0xf8][0xc1][0xcb][0xce][0xd2][0xc3][0xc7][0xa3][0xac][0xb1][0xe3][0xd3][0xda][0xce][0xd2][0xc3][0xc7][0xb7][0xa2][0xcb][0xcd][0xd0][0xc5][0xcf][0xa2][0xa3][0xac][0xce][0xd2][0xc3][0xc7][0xb5][0xf7][0xd3][0xc3] rabbitTemplate.convertAndSend("spring-boot", xxx); [0xbc][0xb4][0xbf][0xc9][0xb7][0xa2][0xcb][0xcd][0xd0][0xc5][0xcf][0xa2][0xa1][0xa3][\r][\n]"
    17:55:37.785 [main] DEBUG org.apache.http.wire - http-outgoing-2 >> "[0xb6][0xd4][0xd3][0xda][0xbd][0xbb][0xbb][0xbb][0xbb][0xfa][0xb6][0xd3][0xc1][0xd0][0xa3][0xba][0xc8][0xe7][0xc9][0xcf][0xb4][0xfa][0xc2][0xeb][0xa3][0xac][0xce][0xd2][0xc3][0xc7][0xd0][0xe8][0xd2][0xaa][0xc5][0xe4][0xd6][0xc3][0xbd][0xbb][0xbb][0xbb][0xbb][0xfa] TopicExchange[0xa3][0xac][0xc5][0xe4][0xd6][0xc3][0xb6][0xd3][0xc1][0xd0] Queue[0xa3][0xac][0xb2][0xa2][0xc7][0xd2][0xc5][0xe4][0xd6][0xc3][0xcb][0xfb
    
    4 条回复    2018-04-27 13:36:38 +08:00
    wellCh4n
        1
    wellCh4n  
       2018-04-26 20:08:18 +08:00
    配置一下 logback 吧
    Eliefly
        2
    Eliefly  
    OP
       2018-04-26 20:52:50 +08:00
    @wellCh4n 谢谢答复,刚刚搞好了,IDEA 配置 Artifact 构建时把日志相关的 jar 全移除了,需要的打印用 System.out ,System.err 。
    letitbesqzr
        3
    letitbesqzr  
       2018-04-26 21:33:39 +08:00
    用 System.out 不用 log 是什么操作。。配置好 logback 不就行了么,最烦看到 System.out 了,不好管理。
    Eliefly
        4
    Eliefly  
    OP
       2018-04-27 13:36:38 +08:00
    @letitbesqzr 一个命令行小工具,没用到 spring 不知道怎么配置打印级别。打印也不多,用 System.out 可以啦。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2941 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 15:13 · PVG 23:13 · LAX 08:13 · JFK 11:13
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.