< prev index next >
src/share/vm/logging/logFileOutput.cpp
Print this page
rev 10661 : [mq]: 8145934
rev 10662 : imported patch 8145934.alternative
@@ -161,10 +161,28 @@
_rotation_semaphore.signal();
return written;
}
+int LogFileOutput::write(LogMessageBuffer::Iterator msg_iterator) {
+ if (_stream == NULL) {
+ // An error has occurred with this output, avoid writing to it.
+ return 0;
+ }
+
+ _rotation_semaphore.wait();
+ int written = LogFileStreamOutput::write(msg_iterator);
+ _current_size += written;
+
+ if (should_rotate()) {
+ rotate();
+ }
+ _rotation_semaphore.signal();
+
+ return written;
+}
+
void LogFileOutput::archive() {
assert(_archive_name != NULL && _archive_name_len > 0, "Rotation must be configured before using this function.");
int ret = jio_snprintf(_archive_name, _archive_name_len, "%s.%0*u",
_file_name, _file_count_max_digits, _current_file);
assert(ret >= 0, "Buffer should always be large enough");
< prev index next >