zoukankan      html  css  js  c++  java
  • 解决idea tomcat乱码问题

    解决idea Server Output、TomcatLocalhost Log、Tomcat Catalina Log控制台乱码问题

    1571192138704

    问题原因:编码不一致,tomcat启动后默认编码UTF-8,而windows的默认编码是GBK。所以只需配置启动tomcat后为GBK编码即可。

    # Describes specific configuration info for Handlers.
    ############################################################
    
    1catalina.org.apache.juli.AsyncFileHandler.level = FINE
    1catalina.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs
    1catalina.org.apache.juli.AsyncFileHandler.prefix = catalina.
    1catalina.org.apache.juli.AsyncFileHandler.maxDays = 90
    1catalina.org.apache.juli.AsyncFileHandler.encoding = GBK
    
    2localhost.org.apache.juli.AsyncFileHandler.level = FINE
    2localhost.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs
    2localhost.org.apache.juli.AsyncFileHandler.prefix = localhost.
    2localhost.org.apache.juli.AsyncFileHandler.maxDays = 90
    2localhost.org.apache.juli.AsyncFileHandler.encoding = GBK
    
    3manager.org.apache.juli.AsyncFileHandler.level = FINE
    3manager.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs
    3manager.org.apache.juli.AsyncFileHandler.prefix = manager.
    3manager.org.apache.juli.AsyncFileHandler.maxDays = 90
    3manager.org.apache.juli.AsyncFileHandler.encoding = GBK
    
    4host-manager.org.apache.juli.AsyncFileHandler.level = FINE
    4host-manager.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs
    4host-manager.org.apache.juli.AsyncFileHandler.prefix = host-manager.
    4host-manager.org.apache.juli.AsyncFileHandler.maxDays = 90
    4host-manager.org.apache.juli.AsyncFileHandler.encoding = GBK
    
    java.util.logging.ConsoleHandler.level = FINE
    java.util.logging.ConsoleHandler.formatter = org.apache.juli.OneLineFormatter
    #java.util.logging.ConsoleHandler.encoding = GBK
    java.util.logging.ConsoleHandler.encoding = GBK
    
    ############################################################
    

    1571192330355

    保存,然后重启tomcat就行了。

    1571192463926

  • 相关阅读:
    特殊字符,如Emoji表情Base64存储到数据库
    判断文本文件的编码
    很多.net 程序员不知道又非常重要的 .net高级调试技巧.调试别人的dll方法内的变量
    没想到你是这样的Linux
    PDF转成txt
    生成云图
    Data collection (imaging)
    Python Conda 软件包升级
    电镜作业2的脚本版本
    电镜作业2
  • 原文地址:https://www.cnblogs.com/mengw/p/11683904.html
Copyright © 2011-2022 走看看