447 for (size_t i = 1; i < LogTag::Count; i++) {
448 jio_fprintf(out, "%s %s", (i == 1 ? "" : ","), LogTag::name(static_cast<LogTagType>(i)));
449 }
450 jio_fprintf(out, "\n Specifying 'all' instead of a tag combination matches all tag combinations.\n\n");
451
452 jio_fprintf(out, "Available log outputs:\n"
453 " stdout, stderr, file=<filename>\n"
454 " Specifying %%p and/or %%t in the filename will expand to the JVM's PID and startup timestamp, respectively.\n\n"
455
456 "Some examples:\n"
457 " -Xlog\n"
458 "\t Log all messages using 'info' level to stdout with 'uptime', 'levels' and 'tags' decorations.\n"
459 "\t (Equivalent to -Xlog:all=info:stdout:uptime,levels,tags).\n\n"
460
461 " -Xlog:gc\n"
462 "\t Log messages tagged with 'gc' tag using 'info' level to stdout, with default decorations.\n\n"
463
464 " -Xlog:gc=debug:file=gc.txt:none\n"
465 "\t Log messages tagged with 'gc' tag using 'debug' level to file 'gc.txt' with no decorations.\n\n"
466
467 " -Xlog:gc=trace:file=gctrace.txt:uptimemillis,pids:filecount=5,filesize=1024\n"
468 "\t Log messages tagged with 'gc' tag using 'trace' level to a rotating fileset of 5 files of size 1MB,\n"
469 "\t using the base name 'gctrace.txt', with 'uptimemillis' and 'pid' decorations.\n\n"
470
471 " -Xlog:gc::uptime,tid\n"
472 "\t Log messages tagged with 'gc' tag using 'info' level to output 'stdout', using 'uptime' and 'tid' decorations.\n\n"
473
474 " -Xlog:gc*=info,rt*=off\n"
475 "\t Log messages tagged with at least 'gc' using 'info' level, but turn off logging of messages tagged with 'rt'.\n"
476 "\t (Messages tagged with both 'gc' and 'rt' will not be logged.)\n\n"
477
478 " -Xlog:disable -Xlog:rt=trace:rttrace.txt\n"
479 "\t Turn off all logging, including warnings and errors,\n"
480 "\t and then enable messages tagged with 'rt' using 'trace' level to file 'rttrace.txt'.\n");
481 }
482
483 void LogConfiguration::rotate_all_outputs() {
484 // Start from index 2 since neither stdout nor stderr can be rotated.
485 for (size_t idx = 2; idx < _n_outputs; idx++) {
486 _outputs[idx]->force_rotate();
487 }
|
447 for (size_t i = 1; i < LogTag::Count; i++) {
448 jio_fprintf(out, "%s %s", (i == 1 ? "" : ","), LogTag::name(static_cast<LogTagType>(i)));
449 }
450 jio_fprintf(out, "\n Specifying 'all' instead of a tag combination matches all tag combinations.\n\n");
451
452 jio_fprintf(out, "Available log outputs:\n"
453 " stdout, stderr, file=<filename>\n"
454 " Specifying %%p and/or %%t in the filename will expand to the JVM's PID and startup timestamp, respectively.\n\n"
455
456 "Some examples:\n"
457 " -Xlog\n"
458 "\t Log all messages using 'info' level to stdout with 'uptime', 'levels' and 'tags' decorations.\n"
459 "\t (Equivalent to -Xlog:all=info:stdout:uptime,levels,tags).\n\n"
460
461 " -Xlog:gc\n"
462 "\t Log messages tagged with 'gc' tag using 'info' level to stdout, with default decorations.\n\n"
463
464 " -Xlog:gc=debug:file=gc.txt:none\n"
465 "\t Log messages tagged with 'gc' tag using 'debug' level to file 'gc.txt' with no decorations.\n\n"
466
467 " -Xlog:gc=trace:file=gctrace.txt:uptimemillis,pids:filecount=5,filesize=1m\n"
468 "\t Log messages tagged with 'gc' tag using 'trace' level to a rotating fileset of 5 files of size 1MB,\n"
469 "\t using the base name 'gctrace.txt', with 'uptimemillis' and 'pid' decorations.\n\n"
470
471 " -Xlog:gc::uptime,tid\n"
472 "\t Log messages tagged with 'gc' tag using 'info' level to output 'stdout', using 'uptime' and 'tid' decorations.\n\n"
473
474 " -Xlog:gc*=info,rt*=off\n"
475 "\t Log messages tagged with at least 'gc' using 'info' level, but turn off logging of messages tagged with 'rt'.\n"
476 "\t (Messages tagged with both 'gc' and 'rt' will not be logged.)\n\n"
477
478 " -Xlog:disable -Xlog:rt=trace:rttrace.txt\n"
479 "\t Turn off all logging, including warnings and errors,\n"
480 "\t and then enable messages tagged with 'rt' using 'trace' level to file 'rttrace.txt'.\n");
481 }
482
483 void LogConfiguration::rotate_all_outputs() {
484 // Start from index 2 since neither stdout nor stderr can be rotated.
485 for (size_t idx = 2; idx < _n_outputs; idx++) {
486 _outputs[idx]->force_rotate();
487 }
|