8288298: Resolve parsing ambiguities in UL
Anton Seoane Ampudia
anton.seoane.ampudia at oracle.com
Mon Oct 7 13:50:12 UTC 2024
Hi all,
During the migration of compiler logs to the UnifiedLogging framework, I have observed that multiline logging does not include decorators for all the lines, instead only adding them for the first one and leaving the rest “dangling”. I have found out that this is already a reported issue in JDK-8288298<https://bugs.openjdk.org/browse/JDK-8288298>, and written a tentative fix for it.
Some initial testing has been yielding insignificant performance changes with normal logging use cases, but before going forward with it I would like to request for comments and opinions on this. As far as I know, it would simplify somewhat “manual reading” of logs, as everything starts right now in the same column, as well as automated parsing as there would be no line ambiguities. Copying from the JBS description:
> log_info(gc)("A\nB"); currently outputs:
> [0s][gc] A
> B
> And after this change will output:
> [0s][gc] A
> [1s][gc] B
>
> This change allows UL to be parsed by regex. Example for per-line parsing:
>
> ^\[ [^\[\]]* \] \[ [^\[\]]* \] (\[ [^\[\]]* \])?
It is worth mentioning that the special case with -Xlog:foldmultilines=true is not affected by this (i.e., if foldmultilines is set to true we do not carry out the line-by-line decorating).
Thanks,
Antón
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/hotspot-dev/attachments/20241007/4817c072/attachment-0001.htm>
More information about the hotspot-dev
mailing list