Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8357014

-Xlog warnings and error messages sent to stdout despite file given

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • None
    • hotspot
    • None

      -Xlog warnings and errors always go to stdout regardless of the `file` attribute; they also go to file, but there seems no way to switch off output to stderr.

      Example:
      ```
        log_trace(os)("trace");
        log_debug(os)("debug");
        log_info(os)("info");
        log_warning(os)("warn");
        log_error(os)("error");
      ```

      with

      ```
      -Xlog:os=debug
      ```
      I get on stdout

      ```
      [0,058s][debug][os] debug
      [0,058s][info ][os] info
      [0,058s][warning][os] warn
      [0,058s][error ][os] error
      ```

      which is fine.

      If I run with

      ```
      -Xlog:os=debug:file=x.log
      ```

      I get a file `a.log` containing the same output, good, but I still see the output for warning and error on stdout:

      ```
      [0,060s][warning][os,rss] warn
      [0,060s][error ][os,rss] error
      ```

      ---

      p.s. a different issue is that warnings and error messages seem to, by default, being written to stdout, which contradicts the UL spec ([1]); however, I do not know if that spec is the current documentation for UL (or if we even have one)

      [1] https://openjdk.org/jeps/158

            stooke Simon Tooke
            stuefe Thomas Stuefe
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: