RFR: 8271186: Add UL option to replace newline char [v2]

Yasumasa Suenaga ysuenaga at openjdk.java.net
Fri Aug 6 02:18:55 UTC 2021


> Most of UL entries would print log in one line, however some categories (e.g. `exceptions`) have multiline entries as following:
> 
> 
> [0.157s][info][exceptions] Exception <a 'java/lang/NullPointerException'{0x000000008b918f70}: test>
>  thrown in interpreter method <{method} {0x00007f8335000248} 'main' '([Ljava/lang/String;)V' in 'Test'>
>  at bci 9 for thread 0x00007f8330017160 (main)
> 
> 
> It is ease to parse with log shipper (Fluent Bit, Logstash, and more) if UL can print all logs in one line.
> Famous log shippers support multiline logs of course, but its configuration tends to be complex, and also some input plugins (e.g. TCP on Fluent Bit) do not support multiline logs.
> 
> So I want to introduce new UL option newline to replace `\n` to other chars. For example, the user specifies `newline=\\n` to UL output, newline char (`\n`) will replace `\\n`.
> 
> After this patch, we can get following logs with `newline=\\n`:
> 
> 
> [0.166s][info][exceptions] Exception <a 'java/lang/NullPointerException'{0x000000008b918f70}: test>\n thrown in interpreter method <{method} {0x00007fbc81000248} 'main' '([Ljava/lang/String;)V' in 'Test'>\n at bci 9 for thread 0x00007fbc9c0171a0 (main)
> 
> 
> I've also filed [CSR](https://bugs.openjdk.java.net/browse/JDK-8271188) for this issue, please review it.

Yasumasa Suenaga has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision:

 - Implement as foldmultilines
 - Merge remote-tracking branch 'upstream/master' into JDK-8271186
 - add inclusion of os.hpp
 - 8271186: Add UL option to replace newline char

-------------

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/4885/files
  - new: https://git.openjdk.java.net/jdk/pull/4885/files/358fbe12..f5214501

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4885&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4885&range=00-01

  Stats: 42441 lines in 523 files changed: 36435 ins; 2851 del; 3155 mod
  Patch: https://git.openjdk.java.net/jdk/pull/4885.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/4885/head:pull/4885

PR: https://git.openjdk.java.net/jdk/pull/4885


More information about the hotspot-runtime-dev mailing list