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