Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to understand the relationship between Tomcat logs and the segmentation of catalina.out files

2025-03-13 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces "how to understand the relationship between Tomcat logs and the segmentation of catalina.out files". In daily operation, I believe many people have doubts about how to understand the relationship between Tomcat logs and the segmentation of catalina.out files. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the question of "how to understand the relationship between Tomcat logs and the division of catalina.out files"! Next, please follow the editor to study!

The relationship between Tomcat logs

A picture is worth a thousand words!

Other logs such as localhost. {yyyy-MM-dd} .log, localhost-access. {yyyy-MM-dd} .log localhost is the name of context, often an application is a name.

Split catalina.out

As shown in the figure above, the catalina.out only gets bigger as the run time gets longer, but the logs output from the console are also useful. For example, some developers like to print e.printStackTrace (), System.out.println (), and System.err.println () to catalina.out. These logs are also useful! So you need to split the log to make a backup.

The easiest way is to use the logrotate (log rotation) function that comes with Linux to split the catalina.out.

Take the catalina.out path as / opt/tomcat/logs/catalina.out for example:

# enter / etc/logrotate.d, which is the configuration directory of the logrotate.d subsystem. It is not recommended to modify the main configuration file. Cd / etc/logrotate.dcat > tomcat

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report