< prev index next >
src/share/vm/logging/logFileOutput.cpp
Print this page
rev 11857 : imported patch 8157948
rev 11858 : [mq]: 8157948.01
*** 29,38 ****
--- 29,39 ----
#include "runtime/arguments.hpp"
#include "runtime/os.inline.hpp"
#include "utilities/globalDefinitions.hpp"
#include "utilities/defaultStream.hpp"
+ const char* LogFileOutput::Prefix = "file=";
const char* LogFileOutput::FileOpenMode = "a";
const char* LogFileOutput::PidFilenamePlaceholder = "%p";
const char* LogFileOutput::TimestampFilenamePlaceholder = "%t";
const char* LogFileOutput::TimestampFormat = "%Y-%m-%d_%H-%M-%S";
const char* LogFileOutput::FileSizeOptionKey = "filesize";
*** 43,53 ****
LogFileOutput::LogFileOutput(const char* name)
: LogFileStreamOutput(NULL), _name(os::strdup_check_oom(name, mtLogging)),
_file_name(NULL), _archive_name(NULL), _archive_name_len(0),
_rotate_size(DefaultFileSize), _file_count(DefaultFileCount),
_current_size(0), _current_file(0), _rotation_semaphore(1) {
! _file_name = make_file_name(name, _pid_str, _vm_start_time_str);
}
void LogFileOutput::set_file_name_parameters(jlong vm_start_time) {
int res = jio_snprintf(_pid_str, sizeof(_pid_str), "%d", os::current_process_id());
assert(res > 0, "PID buffer too small");
--- 44,55 ----
LogFileOutput::LogFileOutput(const char* name)
: LogFileStreamOutput(NULL), _name(os::strdup_check_oom(name, mtLogging)),
_file_name(NULL), _archive_name(NULL), _archive_name_len(0),
_rotate_size(DefaultFileSize), _file_count(DefaultFileCount),
_current_size(0), _current_file(0), _rotation_semaphore(1) {
! assert(strstr(name, Prefix) == name, "invalid output name '%s': missing prefix: %s", name, Prefix);
! _file_name = make_file_name(name + strlen(Prefix), _pid_str, _vm_start_time_str);
}
void LogFileOutput::set_file_name_parameters(jlong vm_start_time) {
int res = jio_snprintf(_pid_str, sizeof(_pid_str), "%d", os::current_process_id());
assert(res > 0, "PID buffer too small");
< prev index next >