Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8303392: Runtime.exec and ProcessBuilder.start should use System logger #12862

Closed
10 changes: 5 additions & 5 deletions src/java.base/share/classes/java/lang/ProcessBuilder.java
Original file line number Diff line number Diff line change
@@ -1082,10 +1082,10 @@ public ProcessBuilder redirectErrorStream(boolean redirectErrorStream) {
* Logging of the information is enabled when the logging level of the
* {@linkplain System#getLogger(String) system logger} named {@code java.lang.ProcessBuilder}
* is {@link System.Logger.Level#DEBUG Level.DEBUG} or {@link System.Logger.Level#TRACE Level.TRACE}.
* When enabled for {@code Level.DEBUG} only the command, directory, stack trace,
* and process id are logged.
* When enabled for {@code Level.TRACE} the arguments are included with the command,
* directory, stack trace, and process id.
* When enabled for {@code Level.DEBUG} only the process id, directory, command, and stack trace
* are logged.
* When enabled for {@code Level.TRACE} the arguments are included with the process id,
* directory, command, and stack trace.
*
* @see Runtime#exec(String[], String[], java.io.File)
*/
@@ -1299,7 +1299,7 @@ private Process start(Redirect[] redirects) throws IOException {
* If the operating system does not support the creation of processes
*
* @implNote
* The start of each process is logged by {@link ProcessBuilder#start()}.
* Each created process is logged, see {@link ProcessBuilder#start()} for details.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reads as if it is logged by default. Perhaps reword as "Logging of the created process can be enabled, see ..."

*
* @throws IOException if an I/O error occurs
* @since 9
12 changes: 6 additions & 6 deletions src/java.base/share/classes/java/lang/Runtime.java
Original file line number Diff line number Diff line change
@@ -350,7 +350,7 @@ public void halt(int status) {
* If {@code command} is empty
*
* @implNote
* The new process creation is logged by {@link ProcessBuilder#start()}.
* The process created is logged, see {@link ProcessBuilder#start()} for details.
*
* @see #exec(String[], String[], File)
* @see ProcessBuilder
@@ -401,7 +401,7 @@ public Process exec(String command) throws IOException {
* If {@code command} is empty
*
* @implNote
* The new process creation is logged by {@link ProcessBuilder#start()}.
* The process created is logged, see {@link ProcessBuilder#start()} for details.
*
* @see #exec(String[], String[], File)
* @see ProcessBuilder
@@ -465,7 +465,7 @@ public Process exec(String command, String[] envp) throws IOException {
* If {@code command} is empty
*
* @implNote
* The new process creation is logged by {@link ProcessBuilder#start()}.
* The process created is logged, see {@link ProcessBuilder#start()} for details.
*
* @see ProcessBuilder
* @since 1.3
@@ -513,7 +513,7 @@ public Process exec(String command, String[] envp, File dir)
* (has length {@code 0})
*
* @implNote
* The new process creation is logged by {@link ProcessBuilder#start()}.
* The process created is logged, see {@link ProcessBuilder#start()} for details.
*
* @see ProcessBuilder
*/
@@ -559,7 +559,7 @@ public Process exec(String[] cmdarray) throws IOException {
* (has length {@code 0})
*
* @implNote
* The new process creation is logged by {@link ProcessBuilder#start()}.
* The process created is logged, see {@link ProcessBuilder#start()} for details.
*
* @see ProcessBuilder
*/
@@ -657,7 +657,7 @@ public Process exec(String[] cmdarray, String[] envp) throws IOException {
* (has length {@code 0})
*
* @implNote
* The new process creation is logged by {@link ProcessBuilder#start()}.
* The process created is logged, see {@link ProcessBuilder#start()} for details.
*
* @see ProcessBuilder
* @since 1.3