< prev index next >

src/share/vm/logging/logConfiguration.cpp

Print this page




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


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