< prev index next >

src/share/vm/logging/logConfiguration.cpp

Print this page

        

@@ -36,10 +36,11 @@
 #include "runtime/os.inline.hpp"
 #include "utilities/globalDefinitions.hpp"
 
 LogOutput** LogConfiguration::_outputs = NULL;
 size_t      LogConfiguration::_n_outputs = 0;
+bool        LogConfiguration::_post_initialized = false;
 
 void LogConfiguration::post_initialize() {
   assert(LogConfiguration_lock != NULL, "Lock must be initialized before post-initialization");
   LogDiagnosticCommand::registerCommand();
   LogHandle(logging) log;

@@ -47,10 +48,12 @@
   if (log.is_trace()) {
     ResourceMark rm;
     MutexLocker ml(LogConfiguration_lock);
     describe(log.trace_stream());
   }
+
+  _post_initialized = true;
 }
 
 void LogConfiguration::initialize(jlong vm_start_time) {
   LogFileOutput::set_file_name_parameters(vm_start_time);
   LogDecorations::set_vm_start_time_millis(vm_start_time);

@@ -349,5 +352,14 @@
 
               " -Xlog:disable -Xlog:rt=trace:rttrace.txt\n"
               "\t Turn off all logging, including warnings and errors,\n"
               "\t and then enable messages tagged with 'rt' using 'trace' level to file 'rttrace.txt'.\n");
 }
+
+void LogConfiguration::rotate_all_outputs() {
+  for (size_t idx = 0; idx < _n_outputs; idx++) {
+    if (_outputs[idx]->is_rotatable()) {
+      _outputs[idx]->rotate(true);
+    }
+  }
+}
+
< prev index next >