This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 209786
Collapse All | Expand All

(-)a/core.startup/arch.xml (+6 lines)
Lines 602-607 Link Here
602
          Allows unit tests to prevent changes to <code>System.err</code> and
602
          Allows unit tests to prevent changes to <code>System.err</code> and
603
          <code>System.out</code> by the logging infrastructure.
603
          <code>System.out</code> by the logging infrastructure.
604
      </api>
604
      </api>
605
      <api name="org.netbeans.log.numberOfFiles" category="friend" group="systemproperty" type="export">
606
          Changes the number of files used for log rotation. If started with
607
          <code>-J-Dorg.netbeans.log.numberOfFiles=number</code> then the log files for
608
          <code>number-1</code> previous executions will be preserved. Default and
609
          minimum number is 3.
610
      </api>
605
      <api name="org.netbeans.core.startup.ModuleList.firstModuleJarWins" category="friend" group="systemproperty" type="export">
611
      <api name="org.netbeans.core.startup.ModuleList.firstModuleJarWins" category="friend" group="systemproperty" type="export">
606
          Disables #113341 so that the first version of a module JAR to be encountered is loaded,
612
          Disables #113341 so that the first version of a module JAR to be encountered is loaded,
607
          even if a later cluster contains a newer version of the same module.
613
          even if a later cluster contains a newer version of the same module.
(-)a/core.startup/src/org/netbeans/core/startup/TopLogging.java (-11 / +17 lines)
Lines 406-426 Link Here
406
            try {
406
            try {
407
                File dir = new File(new File(home, "var"), "log");
407
                File dir = new File(new File(home, "var"), "log");
408
                dir.mkdirs ();
408
                dir.mkdirs ();
409
                File f = new File(dir, "messages.log");
410
                File f1 = new File(dir, "messages.log.1");
411
                File f2 = new File(dir, "messages.log.2");
412
409
413
                if (f2.exists()) {
410
                int n = Integer.getInteger("org.netbeans.log.numberOfFiles", 3); // NOI18N
414
                    f2.delete();
411
                if (n < 3) {
412
                    n = 3;
415
                }
413
                }
416
                if (f1.exists()) {
414
                File[] f = new File[n];
417
                    f1.renameTo(f2);
415
                f[0] = new File(dir, "messages.log");
418
                }
416
                for (int i = 1; i < n; i++) {
419
                if (f.exists()) {
417
                    f[i] = new File(dir, "messages.log." + i);
420
                    f.renameTo(f1);
421
                }
418
                }
422
419
423
                FileOutputStream fout = new FileOutputStream(f, false);
420
                if (f[n - 1].exists()) {
421
                    f[n - 1].delete();
422
                }
423
                for (int i = n - 2; i >= 0; i--) {
424
                    if (f[i].exists()) {
425
                        f[i].renameTo(f[i + 1]);
426
                    }
427
                }
428
429
                FileOutputStream fout = new FileOutputStream(f[0], false);
424
                Handler h = new StreamHandler(fout, NbFormatter.FORMATTER);
430
                Handler h = new StreamHandler(fout, NbFormatter.FORMATTER);
425
                h.setLevel(Level.ALL);
431
                h.setLevel(Level.ALL);
426
                h.setFormatter(NbFormatter.FORMATTER);
432
                h.setFormatter(NbFormatter.FORMATTER);

Return to bug 209786