< prev index next >

src/share/vm/logging/logDiagnosticCommand.cpp

Print this page

        

*** 33,49 **** _output("output", "The name or index (#<index>) of output to configure.", "STRING", false), _output_options("output_options", "Options for the output.", "STRING", false), _what("what", "Configures what tags to log.", "STRING", false), _decorators("decorators", "Configures which decorators to use. Use 'none' or an empty value to remove all.", "STRING", false), _disable("disable", "Turns off all logging and clears the log configuration.", "BOOLEAN", false), ! _list("list", "Lists current log configuration.", "BOOLEAN", false) { _dcmdparser.add_dcmd_option(&_output); _dcmdparser.add_dcmd_option(&_output_options); _dcmdparser.add_dcmd_option(&_what); _dcmdparser.add_dcmd_option(&_decorators); _dcmdparser.add_dcmd_option(&_disable); _dcmdparser.add_dcmd_option(&_list); } int LogDiagnosticCommand::num_arguments() { ResourceMark rm; LogDiagnosticCommand* dcmd = new LogDiagnosticCommand(NULL, false); --- 33,51 ---- _output("output", "The name or index (#<index>) of output to configure.", "STRING", false), _output_options("output_options", "Options for the output.", "STRING", false), _what("what", "Configures what tags to log.", "STRING", false), _decorators("decorators", "Configures which decorators to use. Use 'none' or an empty value to remove all.", "STRING", false), _disable("disable", "Turns off all logging and clears the log configuration.", "BOOLEAN", false), ! _list("list", "Lists current log configuration.", "BOOLEAN", false), ! _rotate("rotate", "Rotates current log.", "BOOLEAN", false) { _dcmdparser.add_dcmd_option(&_output); _dcmdparser.add_dcmd_option(&_output_options); _dcmdparser.add_dcmd_option(&_what); _dcmdparser.add_dcmd_option(&_decorators); _dcmdparser.add_dcmd_option(&_disable); _dcmdparser.add_dcmd_option(&_list); + _dcmdparser.add_dcmd_option(&_rotate); } int LogDiagnosticCommand::num_arguments() { ResourceMark rm; LogDiagnosticCommand* dcmd = new LogDiagnosticCommand(NULL, false);
*** 84,93 **** --- 86,100 ---- MutexLocker ml(LogConfiguration_lock); LogConfiguration::describe(output()); any_command = true; } + if (_rotate.has_value()) { + LogConfiguration::rotate_all_logfile(); + any_command = true; + } + if (!any_command) { // If no argument was provided, print usage print_help(LogDiagnosticCommand::name()); }
< prev index next >