Ecology8配置文件:Resin日志按日期拆分

本文介绍Resin服务器通过配置resin.conf文件实现日志文件的拆分管理方法,包括访问日志、输出日志和错误日志的具体设置。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

默认情况下Resin日志在:WEAVER/Resin/log目录下的jvm-default.log文件中。

当Resin运行时间比较长,如果不及时删除该日志文件,日积月累后该文件会大至N个G,给需要看日志的用户带来及大的不便!!

如何解决这个问题?

答案是:拆分该日志文件!

拆分方式如下,修改 Resin/conf/resin.conf 文件,启用三个标签:“access-log、stdout-log、stderr-log”,参考配置如下:

<?xml version="1.0" encoding="utf-8"?>
<resin xmlns="http://caucho.com/ns/resin" xmlns:resin="http://caucho.com/ns/resin/core">
	<cluster id="app-tier">
		<host-default>
			<!-- 访问日志 -->
			<access-log path="logs/access.log"
				archive-format="access-%Y%m%d.log"
			format='%{loginidweaver}c` %D` %h` %n` %u` "%t"` "%r"`  "%{Referer}i"'
			rollover-period="1D">
				<exclude>\.gif$</exclude>
				<exclude>\.jpg$</exclude>
				<exclude>\.png$</exclude>
				<exclude>\.js$</exclude>
				<exclude>\.css$</exclude>
				<exclude>\.html$</exclude>
				<exclude>\.htm$</exclude>
				<exclude>\.swf$</exclude>
				<exclude>\.cur$</exclude>
			</access-log>
		
			<!-- 输出日志 -->
			<stdout-log path="logs/stdout.log"
				archive-format="stdout-%Y%m%d.log"
			timestamp="[%Y.%m.%d %H:%M:%S.%s]"
			rollover-period="1D"/>
			
			<!-- 错误日志 -->
			<stderr-log path="logs/stderr.log"
				archive-format="stderr-%Y%m%d.log"
			timestamp="[%Y.%m.%d %H:%M:%S.%s]"
			rollover-period="1D"/>
		</host-default>
	</cluster>
</resin>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值