I am running ColdFusion 8 application servers on Windows machines. ColdFusion is running as a Windows service.
我在Windows机器上运行ColdFusion 8应用程序服务器。 ColdFusion作为Windows服务运行。
I have noticed that System.out
file is massive (1GB+) on some of the machines.
我注意到某些机器上的System.out文件很大(1GB +)。
e.g.
C:\ColdFusion8\runtime\bin\System.out
I understand this is where console output ends up when running CF as a service, but is there any JRun setting to allow me to save this file off every x MB, or to limit the size of the file or something similar?
我知道这是在运行CF作为服务时控制台输出结束的地方,但是有没有任何JRun设置允许我每隔x MB保存这个文件,或者限制文件的大小或类似的东西?
All tips appreciated!
所有提示赞赏!
IMPORTANT EDIT:
Based on a discussion here - I thought it important to mention that the System.out
file has gotten large on our machines due to lots of code writing to that file, i.e. using:
根据这里的讨论 - 我认为很重要的是,由于大量代码写入该文件,System.out文件在我们的机器上变得很大,即使用:
sys = createObject("java", "java.lang.System");
sys.out.println(...);
If you are running CF as a console job (i.e from the command line) this is a useful debugging tool, as older versions of CF did not not log to console when using <cflog />
.
如果您将CF作为控制台作业运行(即从命令行),这是一个有用的调试工具,因为旧版本的CF在使用
We've asked our developers to discontinue this practice and instead use <cflog />
or writeLog()
both of which log to the console as well as the the application log (by default).
我们已经要求我们的开发人员停止这种做法,而是使用
1 个解决方案
#1
8
It looks like if you go to the jrun.xml for your ColdFusion server file and find the line:
看起来如果您转到ColdFusion服务器文件的jrun.xml并找到该行:
<service class="jrunx.logger.ConsoleLogEventHandler" name=":service=ConsoleLogEventHandler" />
You should be able to add these bits to it:
您应该能够将这些位添加到它:
<attribute name="rotationSize">200k</attribute>
<attribute name="rotationFiles">3</attribute>
<!-- Use heading to specify an alternate log heading for system event log. -->
<!-- EXAMPLE: <attribute name="heading"># Created by JRun on {date MM/dd HH:mm:ss}</attribute> -->
<attribute name="closeDelay">5000</attribute>
<attribute name="deleteOnExit">false</attribute>
And then manipulate the settings as you see fit. However according to this blog entry, you cannot change the name of the file.
然后根据需要操作设置。但是根据此博客条目,您无法更改文件的名称。
#1
8
It looks like if you go to the jrun.xml for your ColdFusion server file and find the line:
看起来如果您转到ColdFusion服务器文件的jrun.xml并找到该行:
<service class="jrunx.logger.ConsoleLogEventHandler" name=":service=ConsoleLogEventHandler" />
You should be able to add these bits to it:
您应该能够将这些位添加到它:
<attribute name="rotationSize">200k</attribute>
<attribute name="rotationFiles">3</attribute>
<!-- Use heading to specify an alternate log heading for system event log. -->
<!-- EXAMPLE: <attribute name="heading"># Created by JRun on {date MM/dd HH:mm:ss}</attribute> -->
<attribute name="closeDelay">5000</attribute>
<attribute name="deleteOnExit">false</attribute>
And then manipulate the settings as you see fit. However according to this blog entry, you cannot change the name of the file.
然后根据需要操作设置。但是根据此博客条目,您无法更改文件的名称。