26
27 #include "services/diagnosticCommand.hpp"
28
29 // The LogDiagnosticCommand represents the 'VM.log' DCMD
30 // that allows configuration of the logging at runtime.
31 // It can be used to view or modify the current log configuration.
32 // VM.log without additional arguments prints the usage description.
33 // The 'list' argument will list all available log tags,
34 // levels, decorators and currently configured log outputs.
35 // Specifying 'disable' will disable logging completely.
36 // The remaining arguments are used to set a log output to log everything
37 // with the specified tags and levels using the given decorators.
38 class LogDiagnosticCommand : public DCmdWithParser {
39 protected:
40 DCmdArgument<char *> _output;
41 DCmdArgument<char *> _output_options;
42 DCmdArgument<char *> _what;
43 DCmdArgument<char *> _decorators;
44 DCmdArgument<bool> _disable;
45 DCmdArgument<bool> _list;
46
47 public:
48 LogDiagnosticCommand(outputStream* output, bool heap_allocated);
49 void execute(DCmdSource source, TRAPS);
50 static void registerCommand();
51 static int num_arguments();
52
53 static const char* name() {
54 return "VM.log";
55 }
56
57 static const char* description() {
58 return "Lists, enables, disables or changes a log output configuration.";
59 }
60
61 // Used by SecurityManager. This DCMD requires ManagementPermission = control.
62 static const JavaPermission permission() {
63 JavaPermission p = {"java.lang.management.ManagementPermission", "control", NULL};
64 return p;
65 }
66 };
67
68 #endif // SHARE_VM_LOGGING_LOGDIAGNOSTICCOMMAND_HPP
|
26
27 #include "services/diagnosticCommand.hpp"
28
29 // The LogDiagnosticCommand represents the 'VM.log' DCMD
30 // that allows configuration of the logging at runtime.
31 // It can be used to view or modify the current log configuration.
32 // VM.log without additional arguments prints the usage description.
33 // The 'list' argument will list all available log tags,
34 // levels, decorators and currently configured log outputs.
35 // Specifying 'disable' will disable logging completely.
36 // The remaining arguments are used to set a log output to log everything
37 // with the specified tags and levels using the given decorators.
38 class LogDiagnosticCommand : public DCmdWithParser {
39 protected:
40 DCmdArgument<char *> _output;
41 DCmdArgument<char *> _output_options;
42 DCmdArgument<char *> _what;
43 DCmdArgument<char *> _decorators;
44 DCmdArgument<bool> _disable;
45 DCmdArgument<bool> _list;
46 DCmdArgument<bool> _rotate;
47
48 public:
49 LogDiagnosticCommand(outputStream* output, bool heap_allocated);
50 void execute(DCmdSource source, TRAPS);
51 static void registerCommand();
52 static int num_arguments();
53
54 static const char* name() {
55 return "VM.log";
56 }
57
58 static const char* description() {
59 return "Lists, enables, disables, changes a log output configuration, and rotates log.";
60 }
61
62 // Used by SecurityManager. This DCMD requires ManagementPermission = control.
63 static const JavaPermission permission() {
64 JavaPermission p = {"java.lang.management.ManagementPermission", "control", NULL};
65 return p;
66 }
67 };
68
69 #endif // SHARE_VM_LOGGING_LOGDIAGNOSTICCOMMAND_HPP
|