mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8151526: Print -Xlog configuration in the hs_err_pid file
Logging configuration is now printed in hs_err and in vm info. Reviewed-by: coleenp, mlarsson, dholmes
This commit is contained in:
parent
167be2a61c
commit
16c430d2b6
3 changed files with 29 additions and 2 deletions
|
@ -382,7 +382,7 @@ bool LogConfiguration::parse_log_arguments(const char* outputstr,
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LogConfiguration::describe(outputStream* out) {
|
void LogConfiguration::describe_available(outputStream* out){
|
||||||
out->print("Available log levels:");
|
out->print("Available log levels:");
|
||||||
for (size_t i = 0; i < LogLevel::Count; i++) {
|
for (size_t i = 0; i < LogLevel::Count; i++) {
|
||||||
out->print("%s %s", (i == 0 ? "" : ","), LogLevel::name(static_cast<LogLevelType>(i)));
|
out->print("%s %s", (i == 0 ? "" : ","), LogLevel::name(static_cast<LogLevelType>(i)));
|
||||||
|
@ -402,7 +402,9 @@ void LogConfiguration::describe(outputStream* out) {
|
||||||
}
|
}
|
||||||
out->cr();
|
out->cr();
|
||||||
|
|
||||||
ConfigurationLock cl;
|
}
|
||||||
|
|
||||||
|
void LogConfiguration::describe_current_configuration(outputStream* out){
|
||||||
out->print_cr("Log output configuration:");
|
out->print_cr("Log output configuration:");
|
||||||
for (size_t i = 0; i < _n_outputs; i++) {
|
for (size_t i = 0; i < _n_outputs; i++) {
|
||||||
out->print("#" SIZE_FORMAT ": %s %s ", i, _outputs[i]->name(), _outputs[i]->config_string());
|
out->print("#" SIZE_FORMAT ": %s %s ", i, _outputs[i]->name(), _outputs[i]->config_string());
|
||||||
|
@ -416,6 +418,12 @@ void LogConfiguration::describe(outputStream* out) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LogConfiguration::describe(outputStream* out) {
|
||||||
|
describe_available(out);
|
||||||
|
ConfigurationLock cl;
|
||||||
|
describe_current_configuration(out);
|
||||||
|
}
|
||||||
|
|
||||||
void LogConfiguration::print_command_line_help(FILE* out) {
|
void LogConfiguration::print_command_line_help(FILE* out) {
|
||||||
jio_fprintf(out, "-Xlog Usage: -Xlog[:[what][:[output][:[decorators][:output-options]]]]\n"
|
jio_fprintf(out, "-Xlog Usage: -Xlog[:[what][:[output][:[decorators][:output-options]]]]\n"
|
||||||
"\t where 'what' is a combination of tags and levels on the form tag1[+tag2...][*][=level][,...]\n"
|
"\t where 'what' is a combination of tags and levels on the form tag1[+tag2...][*][=level][,...]\n"
|
||||||
|
|
|
@ -37,6 +37,7 @@ class LogTagLevelExpression;
|
||||||
// kept implicitly in the LogTagSets and their LogOutputLists. During configuration the tagsets
|
// kept implicitly in the LogTagSets and their LogOutputLists. During configuration the tagsets
|
||||||
// are iterated over and updated accordingly.
|
// are iterated over and updated accordingly.
|
||||||
class LogConfiguration : public AllStatic {
|
class LogConfiguration : public AllStatic {
|
||||||
|
friend class VMError;
|
||||||
public:
|
public:
|
||||||
// Function for listeners
|
// Function for listeners
|
||||||
typedef void (*UpdateListenerFunction)(void);
|
typedef void (*UpdateListenerFunction)(void);
|
||||||
|
@ -79,6 +80,11 @@ class LogConfiguration : public AllStatic {
|
||||||
// This should be called after any configuration change while still holding ConfigurationLock
|
// This should be called after any configuration change while still holding ConfigurationLock
|
||||||
static void notify_update_listeners();
|
static void notify_update_listeners();
|
||||||
|
|
||||||
|
// Respectively describe the built-in and runtime dependent portions of the configuration.
|
||||||
|
static void describe_available(outputStream* out);
|
||||||
|
static void describe_current_configuration(outputStream* out);
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Initialization and finalization of log configuration, to be run at vm startup and shutdown respectively.
|
// Initialization and finalization of log configuration, to be run at vm startup and shutdown respectively.
|
||||||
static void initialize(jlong vm_start_time);
|
static void initialize(jlong vm_start_time);
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
#include "compiler/compileBroker.hpp"
|
#include "compiler/compileBroker.hpp"
|
||||||
#include "compiler/disassembler.hpp"
|
#include "compiler/disassembler.hpp"
|
||||||
#include "gc/shared/collectedHeap.hpp"
|
#include "gc/shared/collectedHeap.hpp"
|
||||||
|
#include "logging/logConfiguration.hpp"
|
||||||
#include "prims/whitebox.hpp"
|
#include "prims/whitebox.hpp"
|
||||||
#include "runtime/arguments.hpp"
|
#include "runtime/arguments.hpp"
|
||||||
#include "runtime/atomic.inline.hpp"
|
#include "runtime/atomic.inline.hpp"
|
||||||
|
@ -774,6 +775,13 @@ void VMError::report(outputStream* st, bool _verbose) {
|
||||||
st->cr();
|
st->cr();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
STEP(395, "(printing log configuration)")
|
||||||
|
if (_verbose){
|
||||||
|
st->print_cr("Logging:");
|
||||||
|
LogConfiguration::describe_current_configuration(st);
|
||||||
|
st->cr();
|
||||||
|
}
|
||||||
|
|
||||||
STEP(400, "(printing all environment variables)" )
|
STEP(400, "(printing all environment variables)" )
|
||||||
|
|
||||||
if (_verbose) {
|
if (_verbose) {
|
||||||
|
@ -937,6 +945,11 @@ void VMError::print_vm_info(outputStream* st) {
|
||||||
st->cr();
|
st->cr();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// STEP("(printing log configuration)")
|
||||||
|
st->print_cr("Logging:");
|
||||||
|
LogConfiguration::describe(st);
|
||||||
|
st->cr();
|
||||||
|
|
||||||
// STEP("(printing all environment variables)")
|
// STEP("(printing all environment variables)")
|
||||||
|
|
||||||
os::print_environment_variables(st, env_list);
|
os::print_environment_variables(st, env_list);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue