--- old/src/share/vm/logging/logConfiguration.cpp 2016-08-26 14:13:04.861477241 +0200 +++ new/src/share/vm/logging/logConfiguration.cpp 2016-08-26 14:13:04.661478325 +0200 @@ -44,6 +44,9 @@ LogConfiguration::UpdateListenerFunction* LogConfiguration::_listener_callbacks = NULL; size_t LogConfiguration::_n_listener_callbacks = 0; +// LogFileOutput is the default type of output, its type prefix should be used if no type was specified +static const char* implicit_output_prefix = LogFileOutput::Prefix; + // Stack object to take the lock for configuring the logging. // Should only be held during the critical parts of the configuration // (when calling configure_output or reading/modifying the outputs array). @@ -108,6 +111,7 @@ } // Normalizes the given LogOutput name to type=name form. +// For example, foo, "foo", file="foo", will all be normalized to file=foo (no quotes, prefixed). static bool normalize_output_name(const char* full_name, char* buffer, size_t len, outputStream* errstream) { const char* start_quote = strchr(full_name, '"'); const char* equals = strchr(full_name, '='); @@ -128,7 +132,7 @@ prefix = full_name; prefix_len = equals - full_name + 1; } else if (!is_stdout_or_stderr) { - prefix = "file="; + prefix = implicit_output_prefix; prefix_len = strlen(prefix); } size_t name_len = strlen(name); @@ -168,7 +172,7 @@ const char* options, outputStream* errstream) { LogOutput* output; - if (strncmp(name, "file=", strlen("file=")) == 0) { + if (strncmp(name, LogFileOutput::Prefix, strlen(LogFileOutput::Prefix)) == 0) { output = new LogFileOutput(name); } else { errstream->print_cr("Unsupported log output type: %s", name); @@ -395,7 +399,7 @@ } } else { // Output specified using name // Normalize the name, stripping quotes and ensures it includes type prefix - size_t len = strlen(outputstr) + strlen("file=") + 1; + size_t len = strlen(outputstr) + strlen(implicit_output_prefix) + 1; char* normalized = NEW_C_HEAP_ARRAY(char, len, mtLogging); if (!normalize_output_name(outputstr, normalized, len, errstream)) { return false;