1 tomcat  日志详解

1.1  tomcat 日志配置文件

  tomcat 对应日志的配置文件:tomcat目录下的/conf/logging.properties。

  tomcat 的日志等级有:日志输出级别:SEVERE (最高级别) > WARNING > INFO > CONFIG > FINE > FINER(精心) > FINEST (所有内容,最低级别)

  tomcat  有五类日志 :catalina、localhost、manager、admin、host-manager

  /conf/logging.properties 配置文件:

 #可配置项(5类日志):catalina、localhost、manager、admin、host-manager
handlers = 1catalina.org.apache.juli.FileHandler, 2localhost.org.apache.juli.FileHandler,
3manager.org.apache.juli.FileHandler, 4host-manager.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler #日志输出为输出到文件和输出到控制台
.handlers = 1catalina.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler #日志输出级别:SEVERE (最高级别) > WARNING > INFO > CONFIG > FINE > FINER(精心) > FINEST (所有内容,最低级别)
#配置文件使catalina日志输出级别为FINE
1catalina.org.apache.juli.FileHandler.level = FINE
#catalina文件输出位置
1catalina.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
#catalina日志前缀为catalina
1catalina.org.apache.juli.FileHandler.prefix = catalina. #配置文件使localhost日志输出级别为FINE
2localhost.org.apache.juli.FileHandler.level = FINE
#localhost文件输出位置
2localhost.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
#localhost日志前缀为localhost
2localhost.org.apache.juli.FileHandler.prefix = localhost. #配置文件使manager日志输出级别为FINE
3manager.org.apache.juli.FileHandler.level = FINE
#manager文件输出位置
3manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
#manager日志前缀为manager
3manager.org.apache.juli.FileHandler.prefix = manager. #配置文件使host-manager日志输出级别为FINE
4host-manager.org.apache.juli.FileHandler.level = FINE
#host-manager文件输出位置
4host-manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
#host-manager日志前缀为host-manager
4host-manager.org.apache.juli.FileHandler.prefix = host-manager. #配置文件使控制台日志输出级别为FINE
java.util.logging.ConsoleHandler.level = FINE
#控制台日志输出格式
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter #localhost日志文件输出级别为INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = INFO
#localhost日志文件输出处理类2localhost.org.apache.juli.FileHandler
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers = 2localhost.org.apache.juli.FileHandler #manager日志文件输出级别为INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].level = INFO
#manager日志文件输出处理类3manager.org.apache.juli.FileHandler
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].handlers = 3manager.org.apache.juli.FileHandler #host-manager日志文件输出级别为INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].level = INFO
#host-manager日志文件输出处理类4host-manager.org.apache.juli.FileHandler
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].handlers = 4host-manager.org.apache.juli.FileHandler

1.2  tomcat 日志文件详解

 tomcat  有五类日志 :catalina、localhost、manager、admin、host-manager

 1.2.1 catalina.out :

catalina.out即标准输出和标准出错,所有输出到这两个位置的都会进入catalina.out,这里包含tomcat运行自己输出的日志以及应用里向console输出的日志。默认这个日志文件是不会进行自动切割的,我们需要借助其他工具进行切割(注意:catalina.out文件如果过大会影响)

#截取部分日志
-Sep- ::28.358 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/8.0.
-Sep- ::28.361 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Jun :: UTC
-Sep- ::28.361 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 8.0.53.0
-Sep- ::28.361 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Linux
-Sep- ::28.361 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 3.10.-.el7.x86_64
-Sep- ::28.361 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
-Sep- ::28.361 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: /usr/java/jdk1..0_131/jre
-Sep- ::28.361 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_131-b11
-Sep- ::28.361 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
-Sep- ::28.361 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: /opt/tomcat
-Sep- ::28.361 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: /opt/tomcat
-Sep- ::28.361 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/opt/tomcat/conf/logging.properties
-Sep- ::28.362 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Sep- ::28.362 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=
-Sep- ::28.362 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
-Sep- ::28.362 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
-Sep- ::28.362 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/opt/tomcat
-Sep- ::28.362 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/opt/tomcat
-Sep- ::28.362 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/opt/tomcat/temp
-Sep- ::28.362 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
-Sep- ::28.676 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
-Sep- ::28.716 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
-Sep- ::28.731 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
-Sep- ::28.732 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
-Sep- ::28.746 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in ms
-Sep- ::28.794 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina
-Sep- ::28.794 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.
-Sep- ::28.829 INFO [localhost-startStop-] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /opt/tomcat/webapps/ROOT
-Sep- ::29.524 INFO [localhost-startStop-] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /opt/tomcat/webapps/ROOT has finished in ms
-Sep- ::29.524 INFO [localhost-startStop-] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /opt/tomcat/webapps/docs
-Sep- ::29.552 INFO [localhost-startStop-] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /opt/tomcat/webapps/docs has finished in ms
-Sep- ::29.552 INFO [localhost-startStop-] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /opt/tomcat/webapps/examples
-Sep- ::29.987 INFO [localhost-startStop-] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /opt/tomcat/webapps/examples has finished in ms
-Sep- ::29.987 INFO [localhost-startStop-] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /opt/tomcat/webapps/host-manager
-Sep- ::30.033 INFO [localhost-startStop-] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /opt/tomcat/webapps/host-manager has finished in ms
-Sep- ::30.034 INFO [localhost-startStop-] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /opt/tomcat/webapps/manager
-Sep- ::30.064 INFO [localhost-startStop-] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /opt/tomcat/webapps/manager has finished in ms
-Sep- ::30.082 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
-Sep- ::30.099 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
-Sep- ::30.106 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in ms
-- ::
[] [] [INFO]-[Thread: DefaultQuartzScheduler_Worker-] 开始检查系统

1.2.2 catalina.YYYY-MM-DD.log

 catalina.{yyyy-MM-dd}.log是tomcat自己运行的一些日志,这些日志还会输出到catalina.out,但是应用向console输出的日志不会输出到catalina.{yyyy-MM-dd}.log,它是tomcat的启动和暂停时的运行日志,注意,它和catalina.out是里面的内容是不一样的。

-Sep- ::18.713 INFO [main] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["http-nio-8080"]
-Sep- ::18.713 INFO [main] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["ajp-nio-8009"]
-Sep- ::18.713 INFO [main] org.apache.catalina.core.StandardService.stopInternal Stopping service Catalina
-Sep- ::18.741 INFO [] org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler ["http-nio-8080"]
-Sep- ::18.741 INFO [] org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler ["http-nio-8080"]
-Sep- ::18.741 INFO [] org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler ["ajp-nio-8009"]
-Sep- ::18.741 INFO [] org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler ["ajp-nio-8009"]
-Sep- ::13.515 INFO [main] org.apache.catalina.core.StandardServer.await A valid shutdown command was received via the shutdown port. Stopping the Server instance.
-Sep- ::13.518 INFO [main] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["http-nio-8080"]
-Sep- ::13.589 INFO [main] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["ajp-nio-8009"]
-Sep- ::13.643 INFO [main] org.apache.catalina.core.StandardService.stopInternal Stopping service Catalina
-Sep- ::13.743 INFO [main] org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler ["http-nio-8080"]
-Sep- ::13.749 INFO [main] org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler ["ajp-nio-8009"]
-Sep- ::13.757 INFO [main] org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler ["http-nio-8080"]
-Sep- ::13.760 INFO [main] org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler ["ajp-nio-8009"]
-Sep- ::28.358 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/8.0.
-Sep- ::28.361 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Jun :: UTC
-Sep- ::28.361 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 8.0.53.0
-Sep- ::28.361 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Linux
-Sep- ::28.361 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 3.10.-.el7.x86_64
-Sep- ::28.361 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
-Sep- ::28.361 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: /usr/java/jdk1..0_131/jre
-Sep- ::28.361 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_131-b11
-Sep- ::28.361 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
-Sep- ::28.361 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: /opt/tomcat
-Sep- ::28.361 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: /opt/tomcat
-Sep- ::28.361 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/opt/tomcat/conf/logging.properties
-Sep- ::28.362 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Sep- ::28.362 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=
-Sep- ::28.362 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
-Sep- ::28.362 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
-Sep- ::28.362 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/opt/tomcat
-Sep- ::28.362 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/opt/tomcat
-Sep- ::28.362 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/opt/tomcat/temp
-Sep- ::28.362 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
-Sep- ::28.676 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
-Sep- ::28.716 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
-Sep- ::28.731 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
-Sep- ::28.732 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
-Sep- ::28.746 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in ms
-Sep- ::28.794 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina
-Sep- ::28.794 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.
-Sep- ::28.829 INFO [localhost-startStop-] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /opt/tomcat/webapps/ROOT
-Sep- ::29.524 INFO [localhost-startStop-] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /opt/tomcat/webapps/ROOT has finished in ms
-Sep- ::29.524 INFO [localhost-startStop-] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /opt/tomcat/webapps/docs
-Sep- ::29.552 INFO [localhost-startStop-] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /opt/tomcat/webapps/docs has finished in ms
-Sep- ::29.552 INFO [localhost-startStop-] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /opt/tomcat/webapps/examples
-Sep- ::29.987 INFO [localhost-startStop-] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /opt/tomcat/webapps/examples has finished in ms
-Sep- ::29.987 INFO [localhost-startStop-] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /opt/tomcat/webapps/host-manager
-Sep- ::30.033 INFO [localhost-startStop-] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /opt/tomcat/webapps/host-manager has finished in ms
-Sep- ::30.034 INFO [localhost-startStop-] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /opt/tomcat/webapps/manager
-Sep- ::30.064 INFO [localhost-startStop-] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /opt/tomcat/webapps/manager has finished in ms
-Sep- ::30.082 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
-Sep- ::30.099 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
-Sep- ::30.106 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in ms

 1.2.3 localhost.YYYY-MM-DD.log

 localhost.{yyyy-MM-dd}.log主要是应用初始化(listener, filter, servlet)未处理的异常最后被tomcat捕获而输出的日志,它也是包含tomcat的启动和暂停时的运行日志,但它没有catalina.2018-09-19.log 日志全。它只是记录了部分日志。

-Sep- ::15.287 INFO [localhost-startStop-] org.apache.catalina.core.ApplicationContext.log ContextListener: contextInitialized()
-Sep- ::15.287 INFO [localhost-startStop-] org.apache.catalina.core.ApplicationContext.log SessionListener: contextInitialized()
-Sep- ::15.288 INFO [localhost-startStop-] org.apache.catalina.core.ApplicationContext.log ContextListener: attributeAdded('StockTicker', 'async.Stockticker@2f62fc5f')
-Sep- ::18.568 INFO [localhost-startStop-] org.apache.catalina.core.ApplicationContext.log ContextListener: contextInitialized()
-Sep- ::18.568 INFO [localhost-startStop-] org.apache.catalina.core.ApplicationContext.log SessionListener: contextInitialized()
-Sep- ::18.569 INFO [localhost-startStop-] org.apache.catalina.core.ApplicationContext.log ContextListener: attributeAdded('StockTicker', 'async.Stockticker@22890441')
-Sep- ::18.732 INFO [localhost-startStop-] org.apache.catalina.core.ApplicationContext.log SessionListener: contextDestroyed()
-Sep- ::18.732 INFO [localhost-startStop-] org.apache.catalina.core.ApplicationContext.log ContextListener: contextDestroyed()
-Sep- ::13.707 INFO [localhost-startStop-] org.apache.catalina.core.ApplicationContext.log SessionListener: contextDestroyed()
-Sep- ::13.707 INFO [localhost-startStop-] org.apache.catalina.core.ApplicationContext.log ContextListener: contextDestroyed()
-Sep- ::29.980 INFO [localhost-startStop-] org.apache.catalina.core.ApplicationContext.log ContextListener: contextInitialized()
-Sep- ::29.981 INFO [localhost-startStop-] org.apache.catalina.core.ApplicationContext.log SessionListener: contextInitialized()
-Sep- ::29.982 INFO [localhost-startStop-] org.apache.catalina.core.ApplicationContext.log ContextListener: attributeAdded('StockTicker', 'async.Stockticker@46012cd1')

 1.2.4 localhost_access_log.YYYY-MM-DD.txt

 localhost_access_log.2018-09-19.txt:这个是访问tomcat的日志,请求时间和资源,状态码都有记录。

192.168.1.220 - - [/Sep/::: -] "GET / HTTP/1.1"
192.168.1.220 - - [/Sep/::: -] "GET /tomcat.css HTTP/1.1"
192.168.1.220 - - [/Sep/::: -] "GET /tomcat.png HTTP/1.1"
192.168.1.220 - - [/Sep/::: -] "GET /bg-button.png HTTP/1.1"
192.168.1.220 - - [/Sep/::: -] "GET /bg-nav.png HTTP/1.1"
192.168.1.220 - - [/Sep/::: -] "GET /asf-logo-wide.svg HTTP/1.1"
192.168.1.220 - - [/Sep/::: -] "GET /bg-middle.png HTTP/1.1"
192.168.1.220 - - [/Sep/::: -] "GET /bg-upper.png HTTP/1.1"
192.168.1.220 - - [/Sep/::: -] "GET / HTTP/1.1"
192.168.1.220 - - [/Sep/::: -] "GET /favicon.ico HTTP/1.1"
192.168.1.220 - - [/Sep/::: -] "GET / HTTP/1.1"
192.168.1.220 - - [/Sep/::: -] "GET /favicon.ico HTTP/1.1"
192.168.1.220 - - [/Sep/::: -] "GET / HTTP/1.1"
192.168.1.220 - - [/Sep/::: -] "GET /favicon.ico HTTP/1.1"
192.168.1.220 - - [/Sep/::: -] "GET /docs/setup.html HTTP/1.1"
192.168.1.220 - - [/Sep/::: -] "GET /docs/images/docs-stylesheet.css HTTP/1.1"
192.168.1.220 - - [/Sep/::: -] "GET /docs/images/tomcat.png HTTP/1.1"
192.168.1.220 - - [/Sep/::: -] "GET /docs/images/asf-logo.svg HTTP/1.1"
192.168.1.220 - - [/Sep/::: -] "GET /docs/images/fonts/fonts.css HTTP/1.1"
192.168.1.220 - - [/Sep/::: -] "GET /docs/images/fonts/OpenSans400.woff HTTP/1.1"
192.168.1.220 - - [/Sep/::: -] "GET /docs/images/fonts/OpenSans700.woff HTTP/1.1"
192.168.1.220 - - [/Sep/::: -] "GET /docs/images/fonts/OpenSans600.woff HTTP/1.1"

 1.2.5 host-manager.YYYY-MM-DD.log

host-manager.2018-09-19.log:这个估计是放tomcat的自带的manager项目的日志信息的,未看到有什么重要的日志信息。

  1.2.6 manager.YYYY-MM-DD.log

   manager.2018-09-19.log  : 这个是tomcat manager项目专有的日志文件.

1.3 tomcat  日志文件切割

  tomcat  的  catalina.out  文件tomcat 是不会进行日志切割的,当这个文件大于2G  时,会影响tomcat的运行。那么我们需要对这个文件进行日志切割,切割的方法有很多种:

  第一种:

  通过系统自带的切割工具:logrotate来进行切割。

  第二种:

  使用logj4进行切割日志。

  第三种:

  使用用cronolog分割tomcat的catalina.out文件

  以上三种方法见:https://www.cnblogs.com/happy-king/p/9193401.html

tomcat 日志详解的更多相关文章

  1. tomcat日志详解

    1 tomcat 日志详解 1.1 tomcat 日志配置文件 tomcat 对应日志的配置文件:tomcat目录下的/conf/logging.properties. tomcat 的日志等级有:日 ...

  2. [转]Tomcat日志详解

    Tomcat下相关的日志文件: 1.Cataline引擎的日志文件,文件名为catalina.{date}.log 2.Tomcat下内部代码丢出的日志,文件名为localhost.{date}.lo ...

  3. TOMCAT原理详解及请求过程(转载)

    转自https://www.cnblogs.com/hggen/p/6264475.html TOMCAT原理详解及请求过程 Tomcat: Tomcat是一个JSP/Servlet容器.其作为Ser ...

  4. springboot快速入门(二)——项目属性配置(日志详解)

    一.概述 application.properties就是springboot的属性配置文件 在使用spring boot过程中,可以发现项目中只需要极少的配置就能完成相应的功能,这归功于spring ...

  5. tomcat配置文件详解

    Tomcat系列之服务器的安装与配置以及各组件详解   tomcat 配置文件详解

  6. Spark小课堂Week6 启动日志详解

    Spark小课堂Week6 启动日志详解 作为分布式系统,Spark程序是非常难以使用传统方法来进行调试的,所以我们主要的武器是日志,今天会对启动日志进行一下详解. 日志详解 今天主要遍历下Strea ...

  7. MySQL日志文件之错误日志和慢查询日志详解

    今天天气又开始变得很热了,虽然很热很浮躁,但是不能不学习,我在北京向各位问好.今天给大家分享一点关于数据库日志方面的东西,因为日志不仅讨厌而且还很重要,在开发中时常免不了与它的亲密接触,就在前几天公司 ...

  8. [svc]tomcat配置文件详解

    Tomcat系列之服务器的安装与配置以及各组件详解 tomcat 配置文件详解 tomcat安全管理规范

  9. Apache/Nginx/IIS 访问日志详解

    Apache日志详解 1.Apache日志文件名称及所在路径 日志文件一般都是保存在在apache/logs目录下,实际情况可以根据Apache的配置文件去查找日志文件所在的路径. 例如phpstud ...

随机推荐

  1. TCP/IP模型的一个简单解释

    TCP/IP模型是互联网的基础. 想要理解互联网,就必须理解这个模型.但是,它不好懂,我就从来没有搞懂过. 前几天,BetterExplained上有一篇文章,很通俗地解释了这个模型.我读后有一种恍然 ...

  2. console的所有用法

    http://jingyan.baidu.com/article/e75aca855c6419142edac6c1.html  参考它. console.info(), console.debug() ...

  3. web.xml文件中context-param、listener、filter、servlet的执行顺序

    首先可以肯定的是,加载顺序与它们在 web.xml 文件中的先后顺序无关.即不会因为 filter 写在 listener 的前面而会先加载 filter.最终得出的结论是:listener -> ...

  4. Oracle EBS标准错误信息如何追踪 (Debug)

    http://www.cnblogs.com/songdavid/articles/2067534.html 调用EBS标准API的时候,可能会返回一些让人看不懂的错误,比如最近我在开发rcv_tra ...

  5. PO Release Final Closed 灾难恢复

    今天不小心 Final Closed了一条Po Release,只能通过后台更新数据恢复了. 更新后可接收可匹配,但不保证更新数据有遗漏,慎用. 更新前备份各表数据 UPDATE PO_LINE_LO ...

  6. 利用backtrace和backtrace_symbols函数打印调用栈信息

    在头文件"execinfo.h"中声明了三个函数用于获取当前线程的函数调用堆栈. #include <execinfo.h>  int backtrace(void * ...

  7. lnmp下thinkphp 500错误指南

    先在php.ini打开报错,display_errors: on: 如果是open_basedir的问题,修改nginx的配置文件fastcgi.conf 将fastcgi_param PHP_ADM ...

  8. ASP.NET MVC 扩展HtmlHelper类为 js ,css 资源文件添加版本号

    写在前面 在项目部署当中会需要更新 css 文件或 js 等资源文件,为了避免由于浏览器缓存的原因无法加载新的 css 或 js ,一般的做法是在资源文件的后面加上一个版本号来解决,这样浏览器就会去服 ...

  9. 弦论(tjoi2015,bzoj3998)(sam(后缀自动机))

    对于一个给定长度为\(N\)的字符串,求它的第\(K\)小子串是什么. Input 第一行是一个仅由小写英文字母构成的字符串\(S\) 第二行为两个整数\(T\)和\(K\),\(T\)为0则表示不同 ...

  10. Flask从入门到精通之Flask-Bootstrap的使用

    Bootstrap(http://getbootstrap.com/)是Twitter 开发的一个开源框架,它提供的用户界面组件可用于创建整洁且具有吸引力的网页,而且这些网页还能兼容所有现代Web 浏 ...