• Tomcat 关闭日志输出


    spring 应用有自己的日志记录方式(logback 等),就可以关掉 tomcat 自带的日志记录。

    catalina.out

    修改 catalina.sh 文件的输出语句

    if [ -z "$CATALINA_OUT" ] ; then
      CATALINA_OUT="$CATALINA_BASE"/logs/catalina.out
    fi

    修改成下面内容

    if [ -z "$CATALINA_OUT" ] ; then
      CATALINA_OUT=/dev/null
    fi

    conf/logging.properties

    将 level 级别由 FINE 设置成 WARNING 可以大量减少日志的输出,设置成 OFF,直接禁用掉。

    1catalina.org.apache.juli.AsyncFileHandler.level = OFF
    ......
    2localhost.org.apache.juli.AsyncFileHandler.level = OFF
    ......
    3manager.org.apache.juli.AsyncFileHandler.level = OFF
    ......
    4host-manager.org.apache.juli.AsyncFileHandler.level = OFF
    ......
    java.util.logging.ConsoleHandler.level = OFF
    
    
    ############################################################
    # Facility specific properties.
    # Provides extra control for each logger.
    ############################################################
    
    org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = OFF
    ......
    org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].level = OFF
    ......
    org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].level = OFF

    server.xml

    注释掉 AccessLogValve

    <!--<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
                   prefix="localhost_access_log" suffix=".txt"
                   pattern="%h %l %u %t &quot;%r&quot; %s %b" />-->

    https://blog.csdn.net/hj7jay/article/details/73480757

  • 相关阅读:
    [HDOJ1800]Flying to the Mars
    [HDOJ5058]So easy
    HDU 2819 — Swap 二分匹配
    POJ1236
    Codeforces Round #267 (Div. 2) C. George and Job DP
    codeforces Round #263(div2) D. Appleman and Tree 树形dp
    HDU 4345 Permutation dp
    HDU 4349 Xiao Ming's Hope lucas定理
    HDU 4342History repeat itself 数学
    HDU 4341 分组背包
  • 原文地址:https://www.cnblogs.com/jhxxb/p/13158020.html
Copyright © 2020-2023  润新知