Jay Turner
Jay Turner

Reputation: 1

G1 GC logs to file, but some logs still go to stdout

I use the G1 GC settings:

-XX+UseG1GC -XX:+DisableExplicitGC -verbosegc -Xlog:gc*=debug,heap*=debug,safepoint=debug:file=gc.log:tags,time,uptime,level:filecount=0

I get output in my gc.log, but I find that some output is still going to stdout. E.g.:

{other application output}
[1.838s][info][gc] GC(0) Pause Young (Concurrent Start) (Metadata GC Threshold) 95M->19M(5120M) 10.158ms
[1.838s][info][gc] GC(1) Concurrent Cycle
[1.854s][info][gc] GC(1) Pause Remark 20M->20M(5120M) 2.936ms
[1.859s][info][gc] GC(1) Pause Cleanup 20M->20M(5120M) 0.267ms
[1.884s][info][gc] GC(1) Concurrent Cycle 46.148ms
{other application output}
[3.565s][info][gc] GC(2) Pause Young (Normal) (G1 Evacuation Pause) 261M->28M(5120M) 27.996ms
{other application output}
[18.653s][info][gc] GC(3) Pause Young (Normal) (G1 Evacuation Pause) 260M->31M(5120M) 9.021ms
{etc}

The logs going to stdout are marked as [gc], so I would expect my declaration of -Xlog:gc*=debug to send those to the gc.log file. Why are they being written to stdout?

I tried adding gc=info but that made no change. I see that other gc info lines are in the gc.log:

[2024-10-07T12:00:11.434-0500][0.152s][info ][gc            ] Using G1

This occurs under Linux and Windows.

Upvotes: 0

Views: 25

Answers (0)

Related Questions