[jboss-cvs] JBoss Messaging SVN: r6650 - tags/JBossMessaging_1_4_0_SP3_CP03_1456/src/main/org/jboss/jms/debug.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon May 4 09:23:12 EDT 2009
Author: gaohoward
Date: 2009-05-04 09:23:12 -0400 (Mon, 04 May 2009)
New Revision: 6650
Modified:
tags/JBossMessaging_1_4_0_SP3_CP03_1456/src/main/org/jboss/jms/debug/WriterUtil.java
Log:
improve log, limit each log file up to 10.
Modified: tags/JBossMessaging_1_4_0_SP3_CP03_1456/src/main/org/jboss/jms/debug/WriterUtil.java
===================================================================
--- tags/JBossMessaging_1_4_0_SP3_CP03_1456/src/main/org/jboss/jms/debug/WriterUtil.java 2009-05-04 05:54:37 UTC (rev 6649)
+++ tags/JBossMessaging_1_4_0_SP3_CP03_1456/src/main/org/jboss/jms/debug/WriterUtil.java 2009-05-04 13:23:12 UTC (rev 6650)
@@ -23,7 +23,7 @@
public static void main(String[] args) throws FileNotFoundException
{
ControlledPrintWriter writer = new ControlledPrintWriter("/home/howard/myTestFile", true);
- for (int i = 0; i < 600000; i++)
+ for (int i = 0; i < 115; i++)
{
writer.println("writing-------- " + i);
}
@@ -39,8 +39,8 @@
private int ln_counter;
private byte f_counter;
- private static final int FILE_LINES = 800000;
-// private static final int FILE_LINES = 40000;
+// private static final int FILE_LINES = 1000000;
+ private static final int FILE_LINES = 10;
public ControlledPrintWriter(String path, boolean flush) throws FileNotFoundException
{
@@ -60,8 +60,13 @@
internalWriter.close();
//back up
File oldFile = new File(filePath);
- File bkFile = new File(filePath + f_counter);
+ File bkFile = new File(filePath + f_counter%10);
f_counter ++;
+
+ if (bkFile.exists())
+ {
+ bkFile.delete();
+ }
oldFile.renameTo(bkFile);
//startNew
More information about the jboss-cvs-commits
mailing list