You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/04/21 08:12:09 UTC

[GitHub] [flink] wangyang0918 opened a new pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

wangyang0918 opened a new pull request #11839:
URL: https://github.com/apache/flink/pull/11839


   <!--
   *Thank you very much for contributing to Apache Flink - we are happy that you want to help us improve Flink. To help the community review your contribution in the best possible way, please go through the checklist below, which will get the contribution into a shape in which it can be best reviewed.*
   
   *Please understand that we do not do this to make contributions to Flink a hassle. In order to uphold a high standard of quality for code contributions, while at the same time managing a large number of contributions, we need contributors to prepare the contributions well, and give reviewers enough contextual information for the review. Please also understand that contributions that do not follow this guide will take longer to review and thus typically be picked up with lower priority by the community.*
   
   ## Contribution Checklist
   
     - Make sure that the pull request corresponds to a [JIRA issue](https://issues.apache.org/jira/projects/FLINK/issues). Exceptions are made for typos in JavaDoc or documentation files, which need no JIRA issue.
     
     - Name the pull request in the form "[FLINK-XXXX] [component] Title of the pull request", where *FLINK-XXXX* should be replaced by the actual issue number. Skip *component* if you are unsure about which is the best component.
     Typo fixes that have no associated JIRA issue should be named following this pattern: `[hotfix] [docs] Fix typo in event time introduction` or `[hotfix] [javadocs] Expand JavaDoc for PuncuatedWatermarkGenerator`.
   
     - Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
     
     - Make sure that the change passes the automated tests, i.e., `mvn clean verify` passes. You can set up Travis CI to do that following [this guide](https://flink.apache.org/contributing/contribute-code.html#open-a-pull-request).
   
     - Each pull request should address only one issue, not mix up code from multiple issues.
     
     - Each commit in the pull request has a meaningful commit message (including the JIRA id)
   
     - Once all items of the checklist are addressed, remove the above text and this checklist, leaving only the filled out template below.
   
   
   **(The sections below can be removed for hotfixes of typos)**
   -->
   
   ## What is the purpose of the change
   Currently, we when use `flink-console.sh` to start jobmanager/taskmanager start-foreground, the logs could not be accessed via webui. Just because we do not output the logs to the files.
   
   In docker container environment, using `docker logs` to view the logs is a common way. So still need to output the logs to console.
   
   By using System.setOut and System.setErr to redirect the PrintStream to log4j logger, we could output the stdout/stderr to console and file at the same time.
   
   
   ## Brief change log
   
   * Add `StdOutErrRedirector` to redirect stdour/err to the log4j logger
   * Update `log4j-console.properties` to output logs to files
   * Update `log4j-console.properties` to output stdout/err to files and console
   * Update `flink-console.sh`
   
   
   ## Verifying this change
   
   * Added new UT `StdOutErrRedirectorTest`
   * Current all e2e tests should not be affected
   * Manually test logging/stdout/stderr could output to console and file at same time
     * `./bin/jobmanager.sh start-foreground`
     * `./bin/taskmanager.sh start-foreground`
     * View localhost:8081 to check the logs could be accessed via webui
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): (yes / **no**)
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (yes / **no**)
     - The serializers: (yes / **no** / don't know)
     - The runtime per-record code paths (performance sensitive): (yes / **no** / don't know)
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn/Mesos, ZooKeeper: (yes / **no** / don't know)
     - The S3 file system connector: (yes / **no** / don't know)
   
   ## Documentation
   
     - Does this pull request introduce a new feature? (yes / **no**)
     - If yes, how is the feature documented? (**not applicable** / docs / JavaDocs / not documented)
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-617042256


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7841",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161201647",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161221412",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7856",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162139302",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=276",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162146799",
       "triggerID" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=282",
       "triggerID" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162154842",
       "triggerID" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=285",
       "triggerID" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=349",
       "triggerID" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162357202",
       "triggerID" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bcaf191ee0597926ea740092596b34e82592a850",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1379",
       "triggerID" : "bcaf191ee0597926ea740092596b34e82592a850",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d716b1ff179f5b4248a1133641b6f0a4733a9e19",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1398",
       "triggerID" : "d716b1ff179f5b4248a1133641b6f0a4733a9e19",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4e51ffc289a42a5e77afc15038bf4c36b7991316",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1425",
       "triggerID" : "4e51ffc289a42a5e77afc15038bf4c36b7991316",
       "triggerType" : "PUSH"
     }, {
       "hash" : "216b86cf20cccbc2462b36c8edc5b5a396ebd3c0",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1646",
       "triggerID" : "216b86cf20cccbc2462b36c8edc5b5a396ebd3c0",
       "triggerType" : "PUSH"
     }, {
       "hash" : "de71393ce72505e00313c75d5c43060bb86589f7",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1667",
       "triggerID" : "de71393ce72505e00313c75d5c43060bb86589f7",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ab5e8324f0ace63d1e5b3f292dd6d517b056fd21 UNKNOWN
   * 216b86cf20cccbc2462b36c8edc5b5a396ebd3c0 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1646) 
   * de71393ce72505e00313c75d5c43060bb86589f7 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1667) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on issue #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-617042256


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7841",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "PENDING",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161201647",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * c369785530aac75cb69c6445340f0684590921c1 Travis: [PENDING](https://travis-ci.com/github/flink-ci/flink/builds/161201647) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7841) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-617042256


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7841",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161201647",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161221412",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7856",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162139302",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=276",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162146799",
       "triggerID" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=282",
       "triggerID" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162154842",
       "triggerID" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=285",
       "triggerID" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=349",
       "triggerID" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162357202",
       "triggerID" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bcaf191ee0597926ea740092596b34e82592a850",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1379",
       "triggerID" : "bcaf191ee0597926ea740092596b34e82592a850",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d716b1ff179f5b4248a1133641b6f0a4733a9e19",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1398",
       "triggerID" : "d716b1ff179f5b4248a1133641b6f0a4733a9e19",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4e51ffc289a42a5e77afc15038bf4c36b7991316",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1425",
       "triggerID" : "4e51ffc289a42a5e77afc15038bf4c36b7991316",
       "triggerType" : "PUSH"
     }, {
       "hash" : "216b86cf20cccbc2462b36c8edc5b5a396ebd3c0",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "216b86cf20cccbc2462b36c8edc5b5a396ebd3c0",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ab5e8324f0ace63d1e5b3f292dd6d517b056fd21 UNKNOWN
   * 4e51ffc289a42a5e77afc15038bf4c36b7991316 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1425) 
   * 216b86cf20cccbc2462b36c8edc5b5a396ebd3c0 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-617042256


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7841",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161201647",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161221412",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7856",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162139302",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=276",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162146799",
       "triggerID" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=282",
       "triggerID" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162154842",
       "triggerID" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=285",
       "triggerID" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=349",
       "triggerID" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162357202",
       "triggerID" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bcaf191ee0597926ea740092596b34e82592a850",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1379",
       "triggerID" : "bcaf191ee0597926ea740092596b34e82592a850",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d716b1ff179f5b4248a1133641b6f0a4733a9e19",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1398",
       "triggerID" : "d716b1ff179f5b4248a1133641b6f0a4733a9e19",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ab5e8324f0ace63d1e5b3f292dd6d517b056fd21 UNKNOWN
   * d1a93165bb5e47b2b6b2dd680c404722af7ca039 Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/162357202) Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=349) 
   * bcaf191ee0597926ea740092596b34e82592a850 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1379) 
   * d716b1ff179f5b4248a1133641b6f0a4733a9e19 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1398) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] wangyang0918 commented on issue #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
wangyang0918 commented on issue #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-617034550


   cc @tillrohrmann @azagrebin Could you please have a look at your convenience?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-617042256


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7841",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161201647",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161221412",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7856",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162139302",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=276",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162146799",
       "triggerID" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=282",
       "triggerID" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162154842",
       "triggerID" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=285",
       "triggerID" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=349",
       "triggerID" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162357202",
       "triggerID" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bcaf191ee0597926ea740092596b34e82592a850",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1379",
       "triggerID" : "bcaf191ee0597926ea740092596b34e82592a850",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d716b1ff179f5b4248a1133641b6f0a4733a9e19",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1398",
       "triggerID" : "d716b1ff179f5b4248a1133641b6f0a4733a9e19",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4e51ffc289a42a5e77afc15038bf4c36b7991316",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "4e51ffc289a42a5e77afc15038bf4c36b7991316",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ab5e8324f0ace63d1e5b3f292dd6d517b056fd21 UNKNOWN
   * d716b1ff179f5b4248a1133641b6f0a4733a9e19 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1398) 
   * 4e51ffc289a42a5e77afc15038bf4c36b7991316 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] wangyang0918 commented on pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
wangyang0918 commented on pull request #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-629044350


   @zentol I have updated the PR according to the discussion. We will start with `.log` file by using rolling appender. I think it could meet the most requirements and leave the open question about `.out` and `.err` file later.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-617042256


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7841",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161201647",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161221412",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7856",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "CANCELED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162139302",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=276",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "status" : "PENDING",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162146799",
       "triggerID" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=282",
       "triggerID" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ab5e8324f0ace63d1e5b3f292dd6d517b056fd21 UNKNOWN
   * 6e097b629bafde50b88d261cd856d624cf6f89c5 Travis: [CANCELED](https://travis-ci.com/github/flink-ci/flink/builds/162139302) Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=276) 
   * 2ca466db8ef9f2c9ef74cdd830078610dd13506a Travis: [PENDING](https://travis-ci.com/github/flink-ci/flink/builds/162146799) Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=282) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] tillrohrmann commented on pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
tillrohrmann commented on pull request #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-625119028


   Is it possible to limit the size of the `out` files? If not, then this might be an issue.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-617042256


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7841",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161201647",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161221412",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7856",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162139302",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=276",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162146799",
       "triggerID" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=282",
       "triggerID" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162154842",
       "triggerID" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=285",
       "triggerID" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=349",
       "triggerID" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162357202",
       "triggerID" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ab5e8324f0ace63d1e5b3f292dd6d517b056fd21 UNKNOWN
   * d1a93165bb5e47b2b6b2dd680c404722af7ca039 Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/162357202) Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=349) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] zentol merged pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
zentol merged pull request #11839:
URL: https://github.com/apache/flink/pull/11839


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-617042256


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7841",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161201647",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161221412",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7856",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162139302",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=276",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162146799",
       "triggerID" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=282",
       "triggerID" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "status" : "FAILURE",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162154842",
       "triggerID" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=285",
       "triggerID" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=349",
       "triggerID" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "status" : "PENDING",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162357202",
       "triggerID" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ab5e8324f0ace63d1e5b3f292dd6d517b056fd21 UNKNOWN
   * 2c1df7529825b6a0af7e57d29febeade36a758b1 Travis: [FAILURE](https://travis-ci.com/github/flink-ci/flink/builds/162154842) Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=285) 
   * d1a93165bb5e47b2b6b2dd680c404722af7ca039 Travis: [PENDING](https://travis-ci.com/github/flink-ci/flink/builds/162357202) Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=349) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] wangyang0918 commented on pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
wangyang0918 commented on pull request #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-625042466


   I also prefer to use the `ConsoleAppender` in log4j. It is more straightforward and stable.
   
   From the discussion in the ML, it seems that the only concern is about the disk consumption. So do we need to use the `RollingFileAppender` by default in `log4j-console.properties` and set the `MaxFileSize` and `MaxBackupIndex` explicitly?
   
   @tillrohrmann @zentol WDYT?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] wangyang0918 commented on pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
wangyang0918 commented on pull request #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-625138407


   Since we use tee to redirect the stdout to `out` file, it is hard to support rolling file and control the file size. This is also a reason for why we could consider the stream redirection. No duplication, file size control and better readability. 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] wangyang0918 commented on a change in pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
wangyang0918 commented on a change in pull request #11839:
URL: https://github.com/apache/flink/pull/11839#discussion_r415198887



##########
File path: flink-dist/src/main/flink-bin/bin/flink-console.sh
##########
@@ -58,7 +58,18 @@ esac
 
 FLINK_TM_CLASSPATH=`constructFlinkClassPath`
 
-log_setting=("-Dlog4j.configuration=file:${FLINK_CONF_DIR}/log4j-console.properties" "-Dlog4j.configurationFile=file:${FLINK_CONF_DIR}/log4j-console.properties" "-Dlogback.configurationFile=file:${FLINK_CONF_DIR}/logback-console.xml")
+if [ "$FLINK_IDENT_STRING" = "" ]; then
+    FLINK_IDENT_STRING="$USER"
+fi
+
+RANDOM_ID=$(echo $RANDOM | tr '[0-9]' '[a-z]')
+
+FLINK_LOG_PREFIX="${FLINK_LOG_DIR}/flink-${FLINK_IDENT_STRING}-${SERVICE}-${RANDOM_ID}-${HOSTNAME}"

Review comment:
       I think the foreground-start is a little different from daemon-start. We could not get the `pid` of jobmanager/taskmanager process. And use the same logic to generate the log file name. If you think it is necessary to use an `incremental` id, i could update this part.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-617042256


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7841",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161201647",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161221412",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7856",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162139302",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=276",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162146799",
       "triggerID" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=282",
       "triggerID" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162154842",
       "triggerID" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=285",
       "triggerID" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=349",
       "triggerID" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162357202",
       "triggerID" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bcaf191ee0597926ea740092596b34e82592a850",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1379",
       "triggerID" : "bcaf191ee0597926ea740092596b34e82592a850",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d716b1ff179f5b4248a1133641b6f0a4733a9e19",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1398",
       "triggerID" : "d716b1ff179f5b4248a1133641b6f0a4733a9e19",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ab5e8324f0ace63d1e5b3f292dd6d517b056fd21 UNKNOWN
   * bcaf191ee0597926ea740092596b34e82592a850 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1379) 
   * d716b1ff179f5b4248a1133641b6f0a4733a9e19 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1398) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] wangyang0918 commented on a change in pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
wangyang0918 commented on a change in pull request #11839:
URL: https://github.com/apache/flink/pull/11839#discussion_r425639551



##########
File path: flink-dist/src/main/flink-bin/bin/flink-console.sh
##########
@@ -58,7 +58,34 @@ esac
 
 FLINK_TM_CLASSPATH=`constructFlinkClassPath`
 
-log_setting=("-Dlog4j.configuration=file:${FLINK_CONF_DIR}/log4j-console.properties" "-Dlog4j.configurationFile=file:${FLINK_CONF_DIR}/log4j-console.properties" "-Dlogback.configurationFile=file:${FLINK_CONF_DIR}/logback-console.xml")
+if [ "$FLINK_IDENT_STRING" = "" ]; then
+    FLINK_IDENT_STRING="$USER"
+fi
+
+pid=$FLINK_PID_DIR/flink-$FLINK_IDENT_STRING-$SERVICE.pid
+mkdir -p "$FLINK_PID_DIR"
+# The lock needs to be released after use because this script is started foreground
+command -v flock >/dev/null 2>&1
+flock_exist=$?
+if [[ ${flock_exist} -eq 0 ]]; then
+    exec 200<"$FLINK_PID_DIR"
+    flock 200
+fi
+# Remove the pid file when all the processes are dead
+if [ -f "$pid" ];then
+    all_dead=0

Review comment:
       For `flink-daemon.sh`, it provides the `stop` and `stop-all` command so that we could remove the `pid` file there. However, in `flink-console.sh`, the script could be crashed or killed at any time. We may not have chance to remove it. So i put the clean-up logic when starting a new one. Only when all the processes are dead, we could safely delete the `pid` file. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on issue #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-617042256


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7841",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161201647",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "CANCELED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161221412",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7856",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 5a26fbb56d996236c296328a6d673bc01982be5f Travis: [CANCELED](https://travis-ci.com/github/flink-ci/flink/builds/161221412) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7856) 
   * ab5e8324f0ace63d1e5b3f292dd6d517b056fd21 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-617042256


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7841",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161201647",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161221412",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7856",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162139302",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=276",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "status" : "CANCELED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162146799",
       "triggerID" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=282",
       "triggerID" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "status" : "PENDING",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162154842",
       "triggerID" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=285",
       "triggerID" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ab5e8324f0ace63d1e5b3f292dd6d517b056fd21 UNKNOWN
   * 2ca466db8ef9f2c9ef74cdd830078610dd13506a Travis: [CANCELED](https://travis-ci.com/github/flink-ci/flink/builds/162146799) Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=282) 
   * 2c1df7529825b6a0af7e57d29febeade36a758b1 Travis: [PENDING](https://travis-ci.com/github/flink-ci/flink/builds/162154842) Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=285) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] wangyang0918 commented on a change in pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
wangyang0918 commented on a change in pull request #11839:
URL: https://github.com/apache/flink/pull/11839#discussion_r425754483



##########
File path: flink-dist/src/main/flink-bin/bin/flink-console.sh
##########
@@ -70,4 +97,10 @@ if [[ ${JAVA_VERSION} =~ ${IS_NUMBER} ]]; then
 fi
 
 echo "Starting $SERVICE as a console application on host $HOSTNAME."
+
+echo $$ >> "$pid" 2>/dev/null

Review comment:
       Yes, `$$` will return the pid of current process. For the `exec`, i will remove the comments about it.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] wangyang0918 commented on a change in pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
wangyang0918 commented on a change in pull request #11839:
URL: https://github.com/apache/flink/pull/11839#discussion_r425640107



##########
File path: flink-dist/src/main/flink-bin/bin/flink-console.sh
##########
@@ -58,7 +58,34 @@ esac
 
 FLINK_TM_CLASSPATH=`constructFlinkClassPath`
 
-log_setting=("-Dlog4j.configuration=file:${FLINK_CONF_DIR}/log4j-console.properties" "-Dlog4j.configurationFile=file:${FLINK_CONF_DIR}/log4j-console.properties" "-Dlogback.configurationFile=file:${FLINK_CONF_DIR}/logback-console.xml")
+if [ "$FLINK_IDENT_STRING" = "" ]; then
+    FLINK_IDENT_STRING="$USER"
+fi
+
+pid=$FLINK_PID_DIR/flink-$FLINK_IDENT_STRING-$SERVICE.pid
+mkdir -p "$FLINK_PID_DIR"
+# The lock needs to be released after use because this script is started foreground
+command -v flock >/dev/null 2>&1
+flock_exist=$?
+if [[ ${flock_exist} -eq 0 ]]; then

Review comment:
       The `flock_exist` will be reused later when to release the lock. So we need a variable to store it.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-617042256


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7841",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161201647",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161221412",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7856",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162139302",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=276",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162146799",
       "triggerID" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=282",
       "triggerID" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162154842",
       "triggerID" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=285",
       "triggerID" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=349",
       "triggerID" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162357202",
       "triggerID" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ab5e8324f0ace63d1e5b3f292dd6d517b056fd21 UNKNOWN
   * d1a93165bb5e47b2b6b2dd680c404722af7ca039 Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/162357202) Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=349) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on issue #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-617042256


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7841",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "CANCELED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161201647",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "PENDING",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161221412",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7856",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * c369785530aac75cb69c6445340f0684590921c1 Travis: [CANCELED](https://travis-ci.com/github/flink-ci/flink/builds/161201647) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7841) 
   * 5a26fbb56d996236c296328a6d673bc01982be5f Travis: [PENDING](https://travis-ci.com/github/flink-ci/flink/builds/161221412) Azure: [PENDING](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7856) 
   * ab5e8324f0ace63d1e5b3f292dd6d517b056fd21 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] zentol commented on a change in pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
zentol commented on a change in pull request #11839:
URL: https://github.com/apache/flink/pull/11839#discussion_r425726762



##########
File path: flink-dist/src/main/flink-bin/bin/flink-console.sh
##########
@@ -70,4 +97,10 @@ if [[ ${JAVA_VERSION} =~ ${IS_NUMBER} ]]; then
 fi
 
 echo "Starting $SERVICE as a console application on host $HOSTNAME."
+
+echo $$ >> "$pid" 2>/dev/null

Review comment:
       so `$$` returns the PID of the current process?
   
   > and then replace the current program with specified SERVICE in the same process
   
   With this you mean the exec call? if so, I'd omit it, because it raises more questions than it answers. (most notably due to describing behavior several lines down)

##########
File path: flink-dist/src/main/flink-bin/bin/flink-console.sh
##########
@@ -58,7 +58,34 @@ esac
 
 FLINK_TM_CLASSPATH=`constructFlinkClassPath`
 
-log_setting=("-Dlog4j.configuration=file:${FLINK_CONF_DIR}/log4j-console.properties" "-Dlog4j.configurationFile=file:${FLINK_CONF_DIR}/log4j-console.properties" "-Dlogback.configurationFile=file:${FLINK_CONF_DIR}/logback-console.xml")
+if [ "$FLINK_IDENT_STRING" = "" ]; then
+    FLINK_IDENT_STRING="$USER"
+fi
+
+pid=$FLINK_PID_DIR/flink-$FLINK_IDENT_STRING-$SERVICE.pid
+mkdir -p "$FLINK_PID_DIR"
+# The lock needs to be released after use because this script is started foreground
+command -v flock >/dev/null 2>&1
+flock_exist=$?
+if [[ ${flock_exist} -eq 0 ]]; then
+    exec 200<"$FLINK_PID_DIR"
+    flock 200
+fi
+# Remove the pid file when all the processes are dead
+if [ -f "$pid" ];then
+    all_dead=0
+    while read each_pid; do
+        kill -0 $each_pid > /dev/null 2>&1

Review comment:
       add a comment that this checks whether the process is still running

##########
File path: flink-dist/src/main/flink-bin/bin/flink-console.sh
##########
@@ -58,7 +58,34 @@ esac
 
 FLINK_TM_CLASSPATH=`constructFlinkClassPath`
 
-log_setting=("-Dlog4j.configuration=file:${FLINK_CONF_DIR}/log4j-console.properties" "-Dlog4j.configurationFile=file:${FLINK_CONF_DIR}/log4j-console.properties" "-Dlogback.configurationFile=file:${FLINK_CONF_DIR}/logback-console.xml")
+if [ "$FLINK_IDENT_STRING" = "" ]; then
+    FLINK_IDENT_STRING="$USER"
+fi
+
+pid=$FLINK_PID_DIR/flink-$FLINK_IDENT_STRING-$SERVICE.pid
+mkdir -p "$FLINK_PID_DIR"
+# The lock needs to be released after use because this script is started foreground
+command -v flock >/dev/null 2>&1
+flock_exist=$?
+if [[ ${flock_exist} -eq 0 ]]; then
+    exec 200<"$FLINK_PID_DIR"
+    flock 200
+fi
+# Remove the pid file when all the processes are dead
+if [ -f "$pid" ];then
+    all_dead=0

Review comment:
       Shouldn't this cleanup be done in a trap of some sort? Like on-exit remove the PID of this process from the file, and then _maybe_ delete it if empty?

##########
File path: flink-dist/src/main/flink-bin/bin/flink-console.sh
##########
@@ -70,4 +97,10 @@ if [[ ${JAVA_VERSION} =~ ${IS_NUMBER} ]]; then
 fi
 
 echo "Starting $SERVICE as a console application on host $HOSTNAME."
+
+echo $$ >> "$pid" 2>/dev/null
+
+# Release the lock

Review comment:
       ```suggestion
   # Release the lock, because the java process runs in the foreground and would block other processes from modifying the pid file
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] tillrohrmann commented on pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
tillrohrmann commented on pull request #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-625366453


   Hmm, this makes it a bit problematic. It seems as if every possible solutions has a couple of drawbacks...


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-617042256


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7841",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161201647",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161221412",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7856",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162139302",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=276",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162146799",
       "triggerID" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=282",
       "triggerID" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162154842",
       "triggerID" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=285",
       "triggerID" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=349",
       "triggerID" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162357202",
       "triggerID" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bcaf191ee0597926ea740092596b34e82592a850",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1379",
       "triggerID" : "bcaf191ee0597926ea740092596b34e82592a850",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d716b1ff179f5b4248a1133641b6f0a4733a9e19",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1398",
       "triggerID" : "d716b1ff179f5b4248a1133641b6f0a4733a9e19",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4e51ffc289a42a5e77afc15038bf4c36b7991316",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1425",
       "triggerID" : "4e51ffc289a42a5e77afc15038bf4c36b7991316",
       "triggerType" : "PUSH"
     }, {
       "hash" : "216b86cf20cccbc2462b36c8edc5b5a396ebd3c0",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1646",
       "triggerID" : "216b86cf20cccbc2462b36c8edc5b5a396ebd3c0",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ab5e8324f0ace63d1e5b3f292dd6d517b056fd21 UNKNOWN
   * 4e51ffc289a42a5e77afc15038bf4c36b7991316 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1425) 
   * 216b86cf20cccbc2462b36c8edc5b5a396ebd3c0 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1646) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] zentol commented on a change in pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
zentol commented on a change in pull request #11839:
URL: https://github.com/apache/flink/pull/11839#discussion_r415751417



##########
File path: flink-runtime/src/test/java/org/apache/flink/runtime/util/StdOutErrRedirectorTest.java
##########
@@ -0,0 +1,126 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.runtime.util;
+
+import org.apache.flink.api.java.tuple.Tuple1;
+import org.apache.flink.util.TestLogger;
+
+import org.hamcrest.Matchers;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.io.UnsupportedEncodingException;
+import java.util.ArrayList;
+import java.util.List;
+
+import static org.apache.flink.core.testutils.CommonTestUtils.assertThrows;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.notNullValue;
+import static org.junit.Assert.assertThat;
+
+/**
+ * Unit test for StdOutErrRedirector.
+ */
+public class StdOutErrRedirectorTest extends TestLogger {
+
+	private ByteArrayOutputStream byteArrayOutputStream;
+	private PrintStream originalStream;
+
+	@Before
+	public void setUp() throws UnsupportedEncodingException {
+		byteArrayOutputStream = new ByteArrayOutputStream();
+		originalStream = new PrintStream(byteArrayOutputStream, true, "UTF-8");
+	}
+
+	@After
+	public void tearDown() throws IOException {
+		byteArrayOutputStream.close();
+		originalStream.close();
+	}
+
+	@Test
+	public void testNormalPrint() {
+		final int intMsg = 1234;
+		final String strMsg = "some message";
+		final List<String> logContents = new ArrayList<>();
+
+		final PrintStream proxyStream = StdOutErrRedirector.createLoggerProxy(
+			msg -> {
+				assertThat(StdOutErrRedirector.isRedirecting(), is(true));
+				logContents.add(msg);
+			},
+			originalStream);
+
+		assertThat(StdOutErrRedirector.isRedirecting(), is(false));
+
+		proxyStream.print(intMsg);
+		assertThat(StdOutErrRedirector.isRedirecting(), is(false));
+		proxyStream.println(strMsg);
+		assertThat(StdOutErrRedirector.isRedirecting(), is(false));
+
+		assertThat(logContents.size(), is(3));
+		assertThat(logContents, Matchers.contains(String.valueOf(intMsg), strMsg, System.lineSeparator()));
+	}
+
+	@Test
+	public void testRecursivePrint() throws Exception {
+		final String recursive = "recursive";
+		final Tuple1<PrintStream> streamTuple1 = new Tuple1<>();

Review comment:
       use an AtomicReference instead




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on issue #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-617042256


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7841",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "CANCELED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161201647",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "PENDING",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161221412",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7856",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * c369785530aac75cb69c6445340f0684590921c1 Travis: [CANCELED](https://travis-ci.com/github/flink-ci/flink/builds/161201647) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7841) 
   * 5a26fbb56d996236c296328a6d673bc01982be5f Travis: [PENDING](https://travis-ci.com/github/flink-ci/flink/builds/161221412) Azure: [PENDING](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7856) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-617042256


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7841",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161201647",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161221412",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7856",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162139302",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=276",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162146799",
       "triggerID" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=282",
       "triggerID" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162154842",
       "triggerID" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=285",
       "triggerID" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=349",
       "triggerID" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162357202",
       "triggerID" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bcaf191ee0597926ea740092596b34e82592a850",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1379",
       "triggerID" : "bcaf191ee0597926ea740092596b34e82592a850",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ab5e8324f0ace63d1e5b3f292dd6d517b056fd21 UNKNOWN
   * d1a93165bb5e47b2b6b2dd680c404722af7ca039 Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/162357202) Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=349) 
   * bcaf191ee0597926ea740092596b34e82592a850 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1379) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] wangyang0918 commented on pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
wangyang0918 commented on pull request #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-626617247


   You are right. From our internal use case, the biggest problem is `.log` could not be accessed via web dashboard. So maybe we could start with this and leave the `.out` file later until we reach a consensus or find a reasonable solution.
   
   Moreover, i suggest to use the `RollingFileAppender` as default, set `MaxFileSize` to 100MB and `MaxBackupIndex` to 10, which means the logging file will consume 1G disk at most.
   
   @zentol @tillrohrmann What do you think?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] wangyang0918 edited a comment on pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
wangyang0918 edited a comment on pull request #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-620386953


   @zentol If we define the `.out` output as what would be printed to the console(including the logging redirection), then this is indeed the expected behavior. After a careful consideration, i tend to agree with you that **NOT** introduce the stream redirection.
   
   So i will remove the `StdOutErrRedirector` and related log4j/logback configuration. After that things become simpler. We just need to update the script and log4j/logback configuration. Given this, i will force push the new changes.
   
   Thanks a lot for your review and suggestion.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-617042256


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7841",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161201647",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "CANCELED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161221412",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7856",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "PENDING",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162139302",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=276",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 5a26fbb56d996236c296328a6d673bc01982be5f Travis: [CANCELED](https://travis-ci.com/github/flink-ci/flink/builds/161221412) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7856) 
   * ab5e8324f0ace63d1e5b3f292dd6d517b056fd21 UNKNOWN
   * 6e097b629bafde50b88d261cd856d624cf6f89c5 Travis: [PENDING](https://travis-ci.com/github/flink-ci/flink/builds/162139302) Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=276) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] wangyang0918 commented on a change in pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
wangyang0918 commented on a change in pull request #11839:
URL: https://github.com/apache/flink/pull/11839#discussion_r425646976



##########
File path: flink-dist/src/main/flink-bin/bin/flink-console.sh
##########
@@ -70,4 +97,10 @@ if [[ ${JAVA_VERSION} =~ ${IS_NUMBER} ]]; then
 fi
 
 echo "Starting $SERVICE as a console application on host $HOSTNAME."
+
+echo $$ >> "$pid" 2>/dev/null

Review comment:
       I have added a `fixup` commit for this comment.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] zentol commented on a change in pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
zentol commented on a change in pull request #11839:
URL: https://github.com/apache/flink/pull/11839#discussion_r414418912



##########
File path: flink-dist/src/main/flink-bin/bin/flink-console.sh
##########
@@ -58,7 +58,18 @@ esac
 
 FLINK_TM_CLASSPATH=`constructFlinkClassPath`
 
-log_setting=("-Dlog4j.configuration=file:${FLINK_CONF_DIR}/log4j-console.properties" "-Dlog4j.configurationFile=file:${FLINK_CONF_DIR}/log4j-console.properties" "-Dlogback.configurationFile=file:${FLINK_CONF_DIR}/logback-console.xml")
+if [ "$FLINK_IDENT_STRING" = "" ]; then
+    FLINK_IDENT_STRING="$USER"
+fi
+
+RANDOM_ID=$(echo $RANDOM | tr '[0-9]' '[a-z]')
+
+FLINK_LOG_PREFIX="${FLINK_LOG_DIR}/flink-${FLINK_IDENT_STRING}-${SERVICE}-${RANDOM_ID}-${HOSTNAME}"

Review comment:
       this should use the same logic as `flink-daemon.sh`

##########
File path: flink-runtime/src/main/java/org/apache/flink/runtime/util/StdOutErrRedirector.java
##########
@@ -0,0 +1,199 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.runtime.util;
+
+import org.apache.flink.annotation.VisibleForTesting;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.PrintStream;
+
+/**
+ * Redirect std out and std err to logger.
+ */
+public class StdOutErrRedirector {
+
+	private static final String STD_OUT_FILE_PROPERTY_KEY = "stdout.file";
+	private static final String STD_ERR_FILE_PROPERTY_KEY = "stderr.file";
+
+	private static final String STD_OUT_LOGGER_NAME = "StdOutErrRedirector.StdOut";
+	private static final String STD_ERR_LOGGER_NAME = "StdOutErrRedirector.StdErr";
+
+	private static final Logger STD_OUT_LOGGER = LoggerFactory.getLogger(STD_OUT_LOGGER_NAME);
+	private static final Logger STD_ERR_LOGGER = LoggerFactory.getLogger(STD_ERR_LOGGER_NAME);
+
+	private static final ThreadLocal<Boolean> isRedirecting = ThreadLocal.withInitial(() -> false);
+
+	/**
+	 * Try to redirect stdout and stderr.
+	 */
+	public static void redirectStdOutErr() {
+		if (System.getProperty(STD_OUT_FILE_PROPERTY_KEY) != null) {
+			System.setOut(createLoggerProxy(STD_OUT_LOGGER, System.out));
+		}
+
+		if (System.getProperty(STD_ERR_FILE_PROPERTY_KEY) != null) {
+			System.setErr(createLoggerProxy(STD_ERR_LOGGER, System.err));
+		}
+	}
+
+	/**
+	 * Create logger proxy print stream.
+	 * Do not check null, keep the same behavior with System.out/err.
+	 *
+	 * @param originalPrintStream the original print stream
+	 * @return the proxy print stream
+	 */
+	@VisibleForTesting
+	static PrintStream createLoggerProxy(final Logger logger, final PrintStream originalPrintStream) {

Review comment:
       change the Logger argument to a `Consumer<String>`, pass `STD_(OUT|ERR)_LOGGER::info` as method reference, remove TestingLogger.

##########
File path: flink-runtime/src/test/java/org/apache/flink/runtime/util/StdOutErrRedirectorTest.java
##########
@@ -0,0 +1,456 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.runtime.util;
+
+import org.apache.flink.util.TestLogger;
+
+import org.hamcrest.Matchers;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.Marker;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.io.UnsupportedEncodingException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.function.Consumer;
+
+import static org.apache.flink.core.testutils.CommonTestUtils.assertThrows;
+import static org.hamcrest.Matchers.is;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertThat;
+
+/**
+ * Unit test for StdOutErrRedirector.
+ */
+public class StdOutErrRedirectorTest extends TestLogger {
+
+	private ByteArrayOutputStream byteArrayOutputStream;
+	private PrintStream originalStream;
+
+	@Before
+	public void setUp() throws UnsupportedEncodingException {
+		byteArrayOutputStream = new ByteArrayOutputStream();
+		originalStream = new PrintStream(byteArrayOutputStream, true, "UTF-8");
+	}
+
+	@After
+	public void tearDown() throws IOException {
+		byteArrayOutputStream.close();
+		originalStream.close();
+	}
+
+	@Test
+	public void testNormalPrint() {
+		final int intMsg = 1234;
+		final String strMsg = "some message";
+		final List<String> logContents = new ArrayList<>();
+
+		final Logger logger = new TestingLogger(
+			msg -> {
+				assertThat(StdOutErrRedirector.isRedirecting(), is(true));
+				logContents.add(msg);
+			}
+		);
+
+		final PrintStream proxyStream = StdOutErrRedirector.createLoggerProxy(logger, originalStream);
+
+		assertFalse(StdOutErrRedirector.isRedirecting());
+
+		proxyStream.print(intMsg);
+		assertThat(StdOutErrRedirector.isRedirecting(), is(false));
+		proxyStream.println(strMsg);
+		assertThat(StdOutErrRedirector.isRedirecting(), is(false));
+
+		assertThat(logContents.size(), is(3));
+		assertThat(logContents, Matchers.containsInAnyOrder(String.valueOf(intMsg), strMsg, System.lineSeparator()));
+	}
+
+	@Test
+	public void testRecursivePrint() throws Exception {
+		final String recursive = "recursive";
+		final Logger logger = new TestingLogger();
+
+		final PrintStream proxyStream = StdOutErrRedirector.createLoggerProxy(logger, originalStream);
+		((TestingLogger) logger).setMsgConsumer(
+			msg -> {
+				assertThat(StdOutErrRedirector.isRedirecting(), is(true));
+				proxyStream.print(recursive);

Review comment:
       ```suggestion
   				proxyStream.print(msg);
   ```

##########
File path: flink-runtime/src/test/java/org/apache/flink/runtime/util/StdOutErrRedirectorTest.java
##########
@@ -0,0 +1,456 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.runtime.util;
+
+import org.apache.flink.util.TestLogger;
+
+import org.hamcrest.Matchers;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.Marker;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.io.UnsupportedEncodingException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.function.Consumer;
+
+import static org.apache.flink.core.testutils.CommonTestUtils.assertThrows;
+import static org.hamcrest.Matchers.is;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertThat;
+
+/**
+ * Unit test for StdOutErrRedirector.
+ */
+public class StdOutErrRedirectorTest extends TestLogger {
+
+	private ByteArrayOutputStream byteArrayOutputStream;
+	private PrintStream originalStream;
+
+	@Before
+	public void setUp() throws UnsupportedEncodingException {
+		byteArrayOutputStream = new ByteArrayOutputStream();
+		originalStream = new PrintStream(byteArrayOutputStream, true, "UTF-8");
+	}
+
+	@After
+	public void tearDown() throws IOException {
+		byteArrayOutputStream.close();
+		originalStream.close();
+	}
+
+	@Test
+	public void testNormalPrint() {
+		final int intMsg = 1234;
+		final String strMsg = "some message";
+		final List<String> logContents = new ArrayList<>();
+
+		final Logger logger = new TestingLogger(
+			msg -> {
+				assertThat(StdOutErrRedirector.isRedirecting(), is(true));
+				logContents.add(msg);
+			}
+		);
+
+		final PrintStream proxyStream = StdOutErrRedirector.createLoggerProxy(logger, originalStream);
+
+		assertFalse(StdOutErrRedirector.isRedirecting());
+
+		proxyStream.print(intMsg);
+		assertThat(StdOutErrRedirector.isRedirecting(), is(false));
+		proxyStream.println(strMsg);
+		assertThat(StdOutErrRedirector.isRedirecting(), is(false));
+
+		assertThat(logContents.size(), is(3));
+		assertThat(logContents, Matchers.containsInAnyOrder(String.valueOf(intMsg), strMsg, System.lineSeparator()));

Review comment:
       the order should be important

##########
File path: flink-dist/src/main/flink-bin/bin/flink-console.sh
##########
@@ -58,7 +58,18 @@ esac
 
 FLINK_TM_CLASSPATH=`constructFlinkClassPath`
 
-log_setting=("-Dlog4j.configuration=file:${FLINK_CONF_DIR}/log4j-console.properties" "-Dlog4j.configurationFile=file:${FLINK_CONF_DIR}/log4j-console.properties" "-Dlogback.configurationFile=file:${FLINK_CONF_DIR}/logback-console.xml")
+if [ "$FLINK_IDENT_STRING" = "" ]; then
+    FLINK_IDENT_STRING="$USER"
+fi
+
+RANDOM_ID=$(echo $RANDOM | tr '[0-9]' '[a-z]')
+
+FLINK_LOG_PREFIX="${FLINK_LOG_DIR}/flink-${FLINK_IDENT_STRING}-${SERVICE}-${RANDOM_ID}-${HOSTNAME}"
+log="${FLINK_LOG_PREFIX}.log"
+out="${FLINK_LOG_PREFIX}.out"
+err="${FLINK_LOG_PREFIX}.err"

Review comment:
       why are we introducing a dedicated `.err` file? AFAIK no other script has it, why should this one?

##########
File path: flink-runtime/src/test/java/org/apache/flink/runtime/util/StdOutErrRedirectorTest.java
##########
@@ -0,0 +1,456 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.runtime.util;
+
+import org.apache.flink.util.TestLogger;
+
+import org.hamcrest.Matchers;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.Marker;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.io.UnsupportedEncodingException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.function.Consumer;
+
+import static org.apache.flink.core.testutils.CommonTestUtils.assertThrows;
+import static org.hamcrest.Matchers.is;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertThat;
+
+/**
+ * Unit test for StdOutErrRedirector.
+ */
+public class StdOutErrRedirectorTest extends TestLogger {
+
+	private ByteArrayOutputStream byteArrayOutputStream;
+	private PrintStream originalStream;
+
+	@Before
+	public void setUp() throws UnsupportedEncodingException {
+		byteArrayOutputStream = new ByteArrayOutputStream();
+		originalStream = new PrintStream(byteArrayOutputStream, true, "UTF-8");
+	}
+
+	@After
+	public void tearDown() throws IOException {
+		byteArrayOutputStream.close();
+		originalStream.close();
+	}
+
+	@Test
+	public void testNormalPrint() {
+		final int intMsg = 1234;
+		final String strMsg = "some message";
+		final List<String> logContents = new ArrayList<>();
+
+		final Logger logger = new TestingLogger(
+			msg -> {
+				assertThat(StdOutErrRedirector.isRedirecting(), is(true));
+				logContents.add(msg);
+			}
+		);
+
+		final PrintStream proxyStream = StdOutErrRedirector.createLoggerProxy(logger, originalStream);
+
+		assertFalse(StdOutErrRedirector.isRedirecting());

Review comment:
       use assertThat for consistency with the rest of the file




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] wangyang0918 commented on a change in pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
wangyang0918 commented on a change in pull request #11839:
URL: https://github.com/apache/flink/pull/11839#discussion_r425646976



##########
File path: flink-dist/src/main/flink-bin/bin/flink-console.sh
##########
@@ -70,4 +97,10 @@ if [[ ${JAVA_VERSION} =~ ${IS_NUMBER} ]]; then
 fi
 
 echo "Starting $SERVICE as a console application on host $HOSTNAME."
+
+echo $$ >> "$pid" 2>/dev/null

Review comment:
       I will add a comments here.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-617042256


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7841",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161201647",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161221412",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7856",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162139302",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=276",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "status" : "CANCELED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162146799",
       "triggerID" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=282",
       "triggerID" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "status" : "PENDING",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162154842",
       "triggerID" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=285",
       "triggerID" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ab5e8324f0ace63d1e5b3f292dd6d517b056fd21 UNKNOWN
   * 2ca466db8ef9f2c9ef74cdd830078610dd13506a Travis: [CANCELED](https://travis-ci.com/github/flink-ci/flink/builds/162146799) Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=282) 
   * 2c1df7529825b6a0af7e57d29febeade36a758b1 Travis: [PENDING](https://travis-ci.com/github/flink-ci/flink/builds/162154842) Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=285) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-617042256


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7841",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161201647",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161221412",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7856",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162139302",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=276",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162146799",
       "triggerID" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=282",
       "triggerID" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162154842",
       "triggerID" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=285",
       "triggerID" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=349",
       "triggerID" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162357202",
       "triggerID" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bcaf191ee0597926ea740092596b34e82592a850",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1379",
       "triggerID" : "bcaf191ee0597926ea740092596b34e82592a850",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d716b1ff179f5b4248a1133641b6f0a4733a9e19",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1398",
       "triggerID" : "d716b1ff179f5b4248a1133641b6f0a4733a9e19",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4e51ffc289a42a5e77afc15038bf4c36b7991316",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1425",
       "triggerID" : "4e51ffc289a42a5e77afc15038bf4c36b7991316",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ab5e8324f0ace63d1e5b3f292dd6d517b056fd21 UNKNOWN
   * 4e51ffc289a42a5e77afc15038bf4c36b7991316 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1425) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] wangyang0918 commented on pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
wangyang0918 commented on pull request #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-629911292


   @zentol Thanks a lot for the `fixup`.
   I have rebased the latest master and force pushed.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] zentol commented on a change in pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
zentol commented on a change in pull request #11839:
URL: https://github.com/apache/flink/pull/11839#discussion_r425620261



##########
File path: flink-dist/src/main/flink-bin/bin/flink-console.sh
##########
@@ -58,7 +58,34 @@ esac
 
 FLINK_TM_CLASSPATH=`constructFlinkClassPath`
 
-log_setting=("-Dlog4j.configuration=file:${FLINK_CONF_DIR}/log4j-console.properties" "-Dlog4j.configurationFile=file:${FLINK_CONF_DIR}/log4j-console.properties" "-Dlogback.configurationFile=file:${FLINK_CONF_DIR}/logback-console.xml")
+if [ "$FLINK_IDENT_STRING" = "" ]; then
+    FLINK_IDENT_STRING="$USER"
+fi
+
+pid=$FLINK_PID_DIR/flink-$FLINK_IDENT_STRING-$SERVICE.pid
+mkdir -p "$FLINK_PID_DIR"
+# The lock needs to be released after use because this script is started foreground
+command -v flock >/dev/null 2>&1
+flock_exist=$?
+if [[ ${flock_exist} -eq 0 ]]; then
+    exec 200<"$FLINK_PID_DIR"
+    flock 200
+fi
+# Remove the pid file when all the processes are dead
+if [ -f "$pid" ];then
+    all_dead=0

Review comment:
       Why are we re-inventing the wheel and not use the same logic from `flink-daemon.sh`?
   
   `[ $(wc -l < "$pid") -eq 0 ] && rm "$pid"`
   or
   `[ -z $(tail -n 1 "$pid") ] && rm "$pid"`

##########
File path: flink-dist/src/main/flink-bin/bin/flink-console.sh
##########
@@ -58,7 +58,34 @@ esac
 
 FLINK_TM_CLASSPATH=`constructFlinkClassPath`
 
-log_setting=("-Dlog4j.configuration=file:${FLINK_CONF_DIR}/log4j-console.properties" "-Dlog4j.configurationFile=file:${FLINK_CONF_DIR}/log4j-console.properties" "-Dlogback.configurationFile=file:${FLINK_CONF_DIR}/logback-console.xml")
+if [ "$FLINK_IDENT_STRING" = "" ]; then
+    FLINK_IDENT_STRING="$USER"
+fi
+
+pid=$FLINK_PID_DIR/flink-$FLINK_IDENT_STRING-$SERVICE.pid
+mkdir -p "$FLINK_PID_DIR"
+# The lock needs to be released after use because this script is started foreground
+command -v flock >/dev/null 2>&1
+flock_exist=$?
+if [[ ${flock_exist} -eq 0 ]]; then

Review comment:
       ```suggestion
   if [[ $? -eq 0 ]]; then
   ```
   stay consistent with other scripts, so it is more obvious what can be deduplicated later.

##########
File path: flink-dist/src/main/flink-bin/bin/flink-console.sh
##########
@@ -70,4 +97,10 @@ if [[ ${JAVA_VERSION} =~ ${IS_NUMBER} ]]; then
 fi
 
 echo "Starting $SERVICE as a console application on host $HOSTNAME."
+
+echo $$ >> "$pid" 2>/dev/null

Review comment:
       please add a comment for what this does




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] wangyang0918 commented on a change in pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
wangyang0918 commented on a change in pull request #11839:
URL: https://github.com/apache/flink/pull/11839#discussion_r415196303



##########
File path: flink-dist/src/main/flink-bin/bin/flink-console.sh
##########
@@ -58,7 +58,18 @@ esac
 
 FLINK_TM_CLASSPATH=`constructFlinkClassPath`
 
-log_setting=("-Dlog4j.configuration=file:${FLINK_CONF_DIR}/log4j-console.properties" "-Dlog4j.configurationFile=file:${FLINK_CONF_DIR}/log4j-console.properties" "-Dlogback.configurationFile=file:${FLINK_CONF_DIR}/logback-console.xml")
+if [ "$FLINK_IDENT_STRING" = "" ]; then
+    FLINK_IDENT_STRING="$USER"
+fi
+
+RANDOM_ID=$(echo $RANDOM | tr '[0-9]' '[a-z]')
+
+FLINK_LOG_PREFIX="${FLINK_LOG_DIR}/flink-${FLINK_IDENT_STRING}-${SERVICE}-${RANDOM_ID}-${HOSTNAME}"
+log="${FLINK_LOG_PREFIX}.log"
+out="${FLINK_LOG_PREFIX}.out"
+err="${FLINK_LOG_PREFIX}.err"

Review comment:
       Actually, the YARN and K8s deployment always put the stdout to `.out` file and stderr to `.err` file. And i think it is better to separate them if we could.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on issue #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-617042256


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7841",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "PENDING",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161201647",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * c369785530aac75cb69c6445340f0684590921c1 Travis: [PENDING](https://travis-ci.com/github/flink-ci/flink/builds/161201647) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7841) 
   * 5a26fbb56d996236c296328a6d673bc01982be5f UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] wangyang0918 commented on pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
wangyang0918 commented on pull request #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-619471329


   @zentol Thanks a lot for your review.
   
   I agree with you that introducing the stream redirections may take some problems. So we need to be very careful to enable the redirection via `StdOutErrRedirector.redirectStdOutErr`. Currently, i only see the requirements when we want to output the stdout/err to log files and console at the same time. Also i do not have seen a better solution. Using the `tee` will make us have to use the `grep` to filter out the log4j loggings. Just as the discussion in the [ticket](https://issues.apache.org/jira/browse/FLINK-17166?focusedCommentId=17087643&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17087643).
   
   Also not all entrypoints need to do this. I think only the docker environment deployment need(e.g. standalone, K8s). We could put it in the first line in the main of `XXEntrypoint` and i do not find a logging system cache problem here.
   
   The most important concerns when i have to introduce the stream redirection is not about the mixing the `.out` and `.err` file. It is we have to filter out the log4j logging from the stdout/err when using `tee`.
   Actually, the YARN and K8s deployment always put the stdout to `.out` file and stderr to `.err` file. And i think it is better to separate them.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] zentol commented on pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
zentol commented on pull request #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-629803840


   @flinkbot run azure


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-617042256


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7841",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161201647",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161221412",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7856",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162139302",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=276",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162146799",
       "triggerID" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=282",
       "triggerID" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162154842",
       "triggerID" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=285",
       "triggerID" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=349",
       "triggerID" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162357202",
       "triggerID" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bcaf191ee0597926ea740092596b34e82592a850",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1379",
       "triggerID" : "bcaf191ee0597926ea740092596b34e82592a850",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d716b1ff179f5b4248a1133641b6f0a4733a9e19",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "d716b1ff179f5b4248a1133641b6f0a4733a9e19",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ab5e8324f0ace63d1e5b3f292dd6d517b056fd21 UNKNOWN
   * d1a93165bb5e47b2b6b2dd680c404722af7ca039 Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/162357202) Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=349) 
   * bcaf191ee0597926ea740092596b34e82592a850 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1379) 
   * d716b1ff179f5b4248a1133641b6f0a4733a9e19 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-617042256


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7841",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161201647",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "CANCELED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161221412",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7856",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 5a26fbb56d996236c296328a6d673bc01982be5f Travis: [CANCELED](https://travis-ci.com/github/flink-ci/flink/builds/161221412) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7856) 
   * ab5e8324f0ace63d1e5b3f292dd6d517b056fd21 UNKNOWN
   * 6e097b629bafde50b88d261cd856d624cf6f89c5 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] wangyang0918 edited a comment on pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
wangyang0918 edited a comment on pull request #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-619471329


   @zentol Thanks a lot for your review.
   
   I agree with you that introducing the stream redirections may take some problems. So we need to be very careful to enable the redirection via `StdOutErrRedirector.redirectStdOutErr`. Currently, i only see the requirements when we want to output the stdout/err to log files and console at the same time. Also i do not have seen a better solution. Using the `tee` will make us have to use the `grep` to filter out the log4j loggings. Just as the discussion in the [ticket](https://issues.apache.org/jira/browse/FLINK-17166?focusedCommentId=17087643&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17087643).
   
   Also not all entrypoints need to do this. I think only the docker environment deployment need(e.g. standalone, K8s). We could put it in the first line in the main of `XXEntrypoint` and i do not find a logging system cache problem here.
   
   The most important concerns when i have to introduce the stream redirection is not about the mixing the `.out` and `.err` file. It is we have to filter out the log4j logging from the stdout/err when using `tee`.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot commented on issue #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
flinkbot commented on issue #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-617042256


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * c369785530aac75cb69c6445340f0684590921c1 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] tillrohrmann commented on pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
tillrohrmann commented on pull request #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-624744408


   Do we also know the file names in case of log file rotation?
   
   The reason why I find this solution approach a bit less appealing is that it is behaviour which is harder to understand for the user (compared to a single `log4j.properties` file which contains the file and consoler appender).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] wangyang0918 commented on a change in pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
wangyang0918 commented on a change in pull request #11839:
URL: https://github.com/apache/flink/pull/11839#discussion_r415198887



##########
File path: flink-dist/src/main/flink-bin/bin/flink-console.sh
##########
@@ -58,7 +58,18 @@ esac
 
 FLINK_TM_CLASSPATH=`constructFlinkClassPath`
 
-log_setting=("-Dlog4j.configuration=file:${FLINK_CONF_DIR}/log4j-console.properties" "-Dlog4j.configurationFile=file:${FLINK_CONF_DIR}/log4j-console.properties" "-Dlogback.configurationFile=file:${FLINK_CONF_DIR}/logback-console.xml")
+if [ "$FLINK_IDENT_STRING" = "" ]; then
+    FLINK_IDENT_STRING="$USER"
+fi
+
+RANDOM_ID=$(echo $RANDOM | tr '[0-9]' '[a-z]')
+
+FLINK_LOG_PREFIX="${FLINK_LOG_DIR}/flink-${FLINK_IDENT_STRING}-${SERVICE}-${RANDOM_ID}-${HOSTNAME}"

Review comment:
       I think the foreground-start is a little different from daemon-start. If you think it is necessary to use an `incremental` id, i could update this part.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] wangyang0918 commented on pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
wangyang0918 commented on pull request #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-620386953


   @zentol If we define the `.out` output as what would be printed to the console(including the logging redirection), then this is indeed the expected behavior. After a careful consideration, i tend to agree with you that **NOT** introduce the stream redirection.
   
   So i will remove the `StdOutErrRedirector` and related log4j/logback configuration. After that things become simpler. We just need to update the script and log4j/logback configuration. Given this, i will force push the new changes. Thanks a lot for your review and suggestion.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-617042256


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7841",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161201647",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161221412",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7856",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162139302",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=276",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162146799",
       "triggerID" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=282",
       "triggerID" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162154842",
       "triggerID" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=285",
       "triggerID" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=349",
       "triggerID" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162357202",
       "triggerID" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bcaf191ee0597926ea740092596b34e82592a850",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1379",
       "triggerID" : "bcaf191ee0597926ea740092596b34e82592a850",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d716b1ff179f5b4248a1133641b6f0a4733a9e19",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1398",
       "triggerID" : "d716b1ff179f5b4248a1133641b6f0a4733a9e19",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4e51ffc289a42a5e77afc15038bf4c36b7991316",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1425",
       "triggerID" : "4e51ffc289a42a5e77afc15038bf4c36b7991316",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ab5e8324f0ace63d1e5b3f292dd6d517b056fd21 UNKNOWN
   * d716b1ff179f5b4248a1133641b6f0a4733a9e19 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1398) 
   * 4e51ffc289a42a5e77afc15038bf4c36b7991316 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1425) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-617042256


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7841",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161201647",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161221412",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7856",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162139302",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=276",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162146799",
       "triggerID" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=282",
       "triggerID" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "status" : "FAILURE",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162154842",
       "triggerID" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=285",
       "triggerID" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ab5e8324f0ace63d1e5b3f292dd6d517b056fd21 UNKNOWN
   * 2c1df7529825b6a0af7e57d29febeade36a758b1 Travis: [FAILURE](https://travis-ci.com/github/flink-ci/flink/builds/162154842) Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=285) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] zentol commented on pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
zentol commented on pull request #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-626594448


   I'd then suggest to not create a .out file.
   
   My guess is that the lack of .log files is the greater issue anyway.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-617042256


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7841",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161201647",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161221412",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7856",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "CANCELED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162139302",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=276",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "status" : "PENDING",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162146799",
       "triggerID" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=282",
       "triggerID" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ab5e8324f0ace63d1e5b3f292dd6d517b056fd21 UNKNOWN
   * 6e097b629bafde50b88d261cd856d624cf6f89c5 Travis: [CANCELED](https://travis-ci.com/github/flink-ci/flink/builds/162139302) Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=276) 
   * 2ca466db8ef9f2c9ef74cdd830078610dd13506a Travis: [PENDING](https://travis-ci.com/github/flink-ci/flink/builds/162146799) Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=282) 
   * 2c1df7529825b6a0af7e57d29febeade36a758b1 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-617042256


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7841",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161201647",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161221412",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7856",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162139302",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=276",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162146799",
       "triggerID" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=282",
       "triggerID" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162154842",
       "triggerID" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=285",
       "triggerID" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=349",
       "triggerID" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162357202",
       "triggerID" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bcaf191ee0597926ea740092596b34e82592a850",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1379",
       "triggerID" : "bcaf191ee0597926ea740092596b34e82592a850",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d716b1ff179f5b4248a1133641b6f0a4733a9e19",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1398",
       "triggerID" : "d716b1ff179f5b4248a1133641b6f0a4733a9e19",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4e51ffc289a42a5e77afc15038bf4c36b7991316",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1425",
       "triggerID" : "4e51ffc289a42a5e77afc15038bf4c36b7991316",
       "triggerType" : "PUSH"
     }, {
       "hash" : "216b86cf20cccbc2462b36c8edc5b5a396ebd3c0",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1646",
       "triggerID" : "216b86cf20cccbc2462b36c8edc5b5a396ebd3c0",
       "triggerType" : "PUSH"
     }, {
       "hash" : "de71393ce72505e00313c75d5c43060bb86589f7",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "de71393ce72505e00313c75d5c43060bb86589f7",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ab5e8324f0ace63d1e5b3f292dd6d517b056fd21 UNKNOWN
   * 216b86cf20cccbc2462b36c8edc5b5a396ebd3c0 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1646) 
   * de71393ce72505e00313c75d5c43060bb86589f7 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-617042256


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7841",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161201647",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161221412",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7856",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162139302",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=276",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162146799",
       "triggerID" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=282",
       "triggerID" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162154842",
       "triggerID" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=285",
       "triggerID" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=349",
       "triggerID" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162357202",
       "triggerID" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bcaf191ee0597926ea740092596b34e82592a850",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1379",
       "triggerID" : "bcaf191ee0597926ea740092596b34e82592a850",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d716b1ff179f5b4248a1133641b6f0a4733a9e19",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1398",
       "triggerID" : "d716b1ff179f5b4248a1133641b6f0a4733a9e19",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ab5e8324f0ace63d1e5b3f292dd6d517b056fd21 UNKNOWN
   * d716b1ff179f5b4248a1133641b6f0a4733a9e19 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1398) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-617028171


   Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
   to review your pull request. We will use this comment to track the progress of the review.
   
   
   ## Automated Checks
   Last check on commit de71393ce72505e00313c75d5c43060bb86589f7 (Fri Oct 16 10:36:00 UTC 2020)
   
   **Warnings:**
    * No documentation files were touched! Remember to keep the Flink docs up to date!
   
   
   <sub>Mention the bot in a comment to re-run the automated checks.</sub>
   ## Review Progress
   
   * ❓ 1. The [description] looks good.
   * ❓ 2. There is [consensus] that the contribution should go into to Flink.
   * ❓ 3. Needs [attention] from.
   * ❓ 4. The change fits into the overall [architecture].
   * ❓ 5. Overall code [quality] is good.
   
   Please see the [Pull Request Review Guide](https://flink.apache.org/contributing/reviewing-prs.html) for a full explanation of the review process.<details>
    The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot approve description` to approve one or more aspects (aspects: `description`, `consensus`, `architecture` and `quality`)
    - `@flinkbot approve all` to approve all aspects
    - `@flinkbot approve-until architecture` to approve everything until `architecture`
    - `@flinkbot attention @username1 [@username2 ..]` to require somebody's attention
    - `@flinkbot disapprove architecture` to remove an approval you gave earlier
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] wangyang0918 commented on a change in pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
wangyang0918 commented on a change in pull request #11839:
URL: https://github.com/apache/flink/pull/11839#discussion_r425754067



##########
File path: flink-dist/src/main/flink-bin/bin/flink-console.sh
##########
@@ -58,7 +58,34 @@ esac
 
 FLINK_TM_CLASSPATH=`constructFlinkClassPath`
 
-log_setting=("-Dlog4j.configuration=file:${FLINK_CONF_DIR}/log4j-console.properties" "-Dlog4j.configurationFile=file:${FLINK_CONF_DIR}/log4j-console.properties" "-Dlogback.configurationFile=file:${FLINK_CONF_DIR}/logback-console.xml")
+if [ "$FLINK_IDENT_STRING" = "" ]; then
+    FLINK_IDENT_STRING="$USER"
+fi
+
+pid=$FLINK_PID_DIR/flink-$FLINK_IDENT_STRING-$SERVICE.pid
+mkdir -p "$FLINK_PID_DIR"
+# The lock needs to be released after use because this script is started foreground
+command -v flock >/dev/null 2>&1
+flock_exist=$?
+if [[ ${flock_exist} -eq 0 ]]; then
+    exec 200<"$FLINK_PID_DIR"
+    flock 200
+fi
+# Remove the pid file when all the processes are dead
+if [ -f "$pid" ];then
+    all_dead=0

Review comment:
       It is not easy to be done in a `trap` because we need to handle all the signals. The scripts also could be killed -9, then it will not have chance to clean-up. So i suggest to do this before start.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on issue #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-617042256


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7841",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161201647",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "CANCELED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161221412",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7856",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 5a26fbb56d996236c296328a6d673bc01982be5f Travis: [CANCELED](https://travis-ci.com/github/flink-ci/flink/builds/161221412) Azure: [PENDING](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7856) 
   * ab5e8324f0ace63d1e5b3f292dd6d517b056fd21 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] wangyang0918 commented on a change in pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
wangyang0918 commented on a change in pull request #11839:
URL: https://github.com/apache/flink/pull/11839#discussion_r415198887



##########
File path: flink-dist/src/main/flink-bin/bin/flink-console.sh
##########
@@ -58,7 +58,18 @@ esac
 
 FLINK_TM_CLASSPATH=`constructFlinkClassPath`
 
-log_setting=("-Dlog4j.configuration=file:${FLINK_CONF_DIR}/log4j-console.properties" "-Dlog4j.configurationFile=file:${FLINK_CONF_DIR}/log4j-console.properties" "-Dlogback.configurationFile=file:${FLINK_CONF_DIR}/logback-console.xml")
+if [ "$FLINK_IDENT_STRING" = "" ]; then
+    FLINK_IDENT_STRING="$USER"
+fi
+
+RANDOM_ID=$(echo $RANDOM | tr '[0-9]' '[a-z]')
+
+FLINK_LOG_PREFIX="${FLINK_LOG_DIR}/flink-${FLINK_IDENT_STRING}-${SERVICE}-${RANDOM_ID}-${HOSTNAME}"

Review comment:
       I think the foreground-start is a little different from daemon-start. I will update this part to use an `incremental` id and try to reuse the logic with `flink-daemon.sh`.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot commented on issue #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
flinkbot commented on issue #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-617028171


   Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
   to review your pull request. We will use this comment to track the progress of the review.
   
   
   ## Automated Checks
   Last check on commit c369785530aac75cb69c6445340f0684590921c1 (Tue Apr 21 08:16:20 UTC 2020)
   
   **Warnings:**
    * No documentation files were touched! Remember to keep the Flink docs up to date!
   
   
   <sub>Mention the bot in a comment to re-run the automated checks.</sub>
   ## Review Progress
   
   * ❓ 1. The [description] looks good.
   * ❓ 2. There is [consensus] that the contribution should go into to Flink.
   * ❓ 3. Needs [attention] from.
   * ❓ 4. The change fits into the overall [architecture].
   * ❓ 5. Overall code [quality] is good.
   
   Please see the [Pull Request Review Guide](https://flink.apache.org/contributing/reviewing-prs.html) for a full explanation of the review process.<details>
    The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot approve description` to approve one or more aspects (aspects: `description`, `consensus`, `architecture` and `quality`)
    - `@flinkbot approve all` to approve all aspects
    - `@flinkbot approve-until architecture` to approve everything until `architecture`
    - `@flinkbot attention @username1 [@username2 ..]` to require somebody's attention
    - `@flinkbot disapprove architecture` to remove an approval you gave earlier
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] zentol commented on a change in pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
zentol commented on a change in pull request #11839:
URL: https://github.com/apache/flink/pull/11839#discussion_r415757517



##########
File path: flink-dist/src/main/flink-bin/bin/flink-console.sh
##########
@@ -58,7 +58,19 @@ esac
 
 FLINK_TM_CLASSPATH=`constructFlinkClassPath`
 
-log_setting=("-Dlog4j.configuration=file:${FLINK_CONF_DIR}/log4j-console.properties" "-Dlog4j.configurationFile=file:${FLINK_CONF_DIR}/log4j-console.properties" "-Dlogback.configurationFile=file:${FLINK_CONF_DIR}/logback-console.xml")
+if [ "$FLINK_IDENT_STRING" = "" ]; then
+    FLINK_IDENT_STRING="$USER"
+fi
+
+pid=$FLINK_PID_DIR/flink-foreground-$FLINK_IDENT_STRING-$SERVICE.pid
+id=$(getFlinkDaemonID $pid 0)
+
+FLINK_LOG_PREFIX="${FLINK_LOG_DIR}/flink-foreground-${FLINK_IDENT_STRING}-${SERVICE}-${id}-${HOSTNAME}"

Review comment:
       I see no reason why we should have this in the name.
   ```suggestion
   FLINK_LOG_PREFIX="${FLINK_LOG_DIR}/flink-${FLINK_IDENT_STRING}-${SERVICE}-${id}-${HOSTNAME}"
   ```

##########
File path: flink-dist/src/main/flink-bin/bin/config.sh
##########
@@ -660,3 +660,39 @@ extractExecutionParams() {
 
     echo ${execution_config} | sed "s/$EXECUTION_PREFIX//"
 }
+
+getFlinkDaemonID() {
+    local pid=$1
+    local clean_up_when_all_processes_dead=${2:-1}
+
+    mkdir -p "$FLINK_PID_DIR"
+
+    # Log files for daemons are indexed from the process ID's position in the PID
+    # file. The following lock prevents a race condition during daemon startup
+    # when multiple daemons read, index, and write to the PID file concurrently.
+    # The lock is created on the PID directory since a lock file cannot be safely
+    # removed. The daemon is started with the lock closed and the lock remains
+    # active in this script until the script exits.
+    command -v flock >/dev/null 2>&1
+    if [[ $? -eq 0 ]]; then
+        exec 200<"$FLINK_PID_DIR"
+        flock 200
+    fi
+
+    # Remove the pid file when all the processes are dead

Review comment:
       this surely is not a side-effect this method should have

##########
File path: flink-dist/src/main/flink-bin/bin/flink-console.sh
##########
@@ -58,7 +58,18 @@ esac
 
 FLINK_TM_CLASSPATH=`constructFlinkClassPath`
 
-log_setting=("-Dlog4j.configuration=file:${FLINK_CONF_DIR}/log4j-console.properties" "-Dlog4j.configurationFile=file:${FLINK_CONF_DIR}/log4j-console.properties" "-Dlogback.configurationFile=file:${FLINK_CONF_DIR}/logback-console.xml")
+if [ "$FLINK_IDENT_STRING" = "" ]; then
+    FLINK_IDENT_STRING="$USER"
+fi
+
+RANDOM_ID=$(echo $RANDOM | tr '[0-9]' '[a-z]')
+
+FLINK_LOG_PREFIX="${FLINK_LOG_DIR}/flink-${FLINK_IDENT_STRING}-${SERVICE}-${RANDOM_ID}-${HOSTNAME}"
+log="${FLINK_LOG_PREFIX}.log"
+out="${FLINK_LOG_PREFIX}.out"
+err="${FLINK_LOG_PREFIX}.err"

Review comment:
       > And i think it is better to separate them if we could.
   
   That may be so, but the scripts should have a consistent behavior.

##########
File path: flink-dist/src/main/flink-bin/bin/config.sh
##########
@@ -660,3 +660,39 @@ extractExecutionParams() {
 
     echo ${execution_config} | sed "s/$EXECUTION_PREFIX//"
 }
+
+getFlinkDaemonID() {
+    local pid=$1
+    local clean_up_when_all_processes_dead=${2:-1}
+
+    mkdir -p "$FLINK_PID_DIR"
+
+    # Log files for daemons are indexed from the process ID's position in the PID
+    # file. The following lock prevents a race condition during daemon startup
+    # when multiple daemons read, index, and write to the PID file concurrently.
+    # The lock is created on the PID directory since a lock file cannot be safely
+    # removed. The daemon is started with the lock closed and the lock remains
+    # active in this script until the script exits.
+    command -v flock >/dev/null 2>&1
+    if [[ $? -eq 0 ]]; then
+        exec 200<"$FLINK_PID_DIR"
+        flock 200
+    fi
+
+    # Remove the pid file when all the processes are dead
+    if [ -f "$pid" ];then
+        local all_dead=0
+        while read each_pid; do
+            kill -0 $each_pid > /dev/null 2>&1
+            if [[ $? -eq 0 ]] ; then
+                all_dead=1
+            fi
+        done < "$pid"
+        [ $clean_up_when_all_processes_dead -eq 0 -a $all_dead -eq 0 ] && rm $pid
+    fi
+
+    # Ascending ID depending on number of lines in pid file.
+    # This allows us to start multiple daemon of each type.
+    local id=$([ -f "$pid" ] && echo $(wc -l < "$pid") || echo "0")
+    echo $id

Review comment:
       Can we not simplify this?
   ```suggestion
       echo $([ -f "$pid" ] && echo $(wc -l < "$pid") || echo "0")
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-617042256


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7841",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161201647",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161221412",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7856",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162139302",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=276",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162146799",
       "triggerID" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=282",
       "triggerID" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "status" : "FAILURE",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162154842",
       "triggerID" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=285",
       "triggerID" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ab5e8324f0ace63d1e5b3f292dd6d517b056fd21 UNKNOWN
   * 2c1df7529825b6a0af7e57d29febeade36a758b1 Travis: [FAILURE](https://travis-ci.com/github/flink-ci/flink/builds/162154842) Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=285) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] zentol commented on pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
zentol commented on pull request #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-624800779


   That depends on whether they share a filename prefix, which would be reasonable though. Could be a problem at the point of rolling though as we could miss some messages 🤫 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] wangyang0918 commented on a change in pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
wangyang0918 commented on a change in pull request #11839:
URL: https://github.com/apache/flink/pull/11839#discussion_r425639551



##########
File path: flink-dist/src/main/flink-bin/bin/flink-console.sh
##########
@@ -58,7 +58,34 @@ esac
 
 FLINK_TM_CLASSPATH=`constructFlinkClassPath`
 
-log_setting=("-Dlog4j.configuration=file:${FLINK_CONF_DIR}/log4j-console.properties" "-Dlog4j.configurationFile=file:${FLINK_CONF_DIR}/log4j-console.properties" "-Dlogback.configurationFile=file:${FLINK_CONF_DIR}/logback-console.xml")
+if [ "$FLINK_IDENT_STRING" = "" ]; then
+    FLINK_IDENT_STRING="$USER"
+fi
+
+pid=$FLINK_PID_DIR/flink-$FLINK_IDENT_STRING-$SERVICE.pid
+mkdir -p "$FLINK_PID_DIR"
+# The lock needs to be released after use because this script is started foreground
+command -v flock >/dev/null 2>&1
+flock_exist=$?
+if [[ ${flock_exist} -eq 0 ]]; then
+    exec 200<"$FLINK_PID_DIR"
+    flock 200
+fi
+# Remove the pid file when all the processes are dead
+if [ -f "$pid" ];then
+    all_dead=0

Review comment:
       For `flink-daemon.sh`, it provides the `stop` and `stop-all` command so that we could remove the `pid` file there. However, in `flink-console.sh`, the script is start with foreground and could be crashed or killed at any time. We may not have chance to remove it. So i put the clean-up logic when starting a new one. Only when all the processes are dead, we could safely delete the `pid` file. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] zentol commented on pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
zentol commented on pull request #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-619942989


   First up, please remember to push updates to a PR as separate commits, so I can see easily which comments have been addressed.
   
   >  Using the tee will make us have to use the grep to filter out the log4j loggings. Just as the discussion in the ticket.
   
   As I said:
   
   > As I understand it the only problem we had with the tee approach was that the logging output also ends up in .out .
   I'm wondering if this is really such a big problem; if we define the .out output as what would be printed to the console, then this is perfectly acceptable behavior.
   
   Moving on:
   
   > Not all entrypoints need to do redirect the streams. Currently, i think only the docker environment deployment need(e.g. standalone, K8s).
   
   This both implies different behaviors depending on how you deploy Flink, and can introduce subtle issues if the supported entry points change. This is exactly the kind of inconsistent behaviors we shouldn't be introducing.
   
   > As you have said that the logging framework will cache the OutputStream at creation time, could you share me more insights here?
   
   Unfortunately no, but I have been bitten by this in the past.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-617042256


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7841",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161201647",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161221412",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7856",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162139302",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=276",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162146799",
       "triggerID" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=282",
       "triggerID" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162154842",
       "triggerID" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=285",
       "triggerID" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=349",
       "triggerID" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162357202",
       "triggerID" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bcaf191ee0597926ea740092596b34e82592a850",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1379",
       "triggerID" : "bcaf191ee0597926ea740092596b34e82592a850",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d716b1ff179f5b4248a1133641b6f0a4733a9e19",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1398",
       "triggerID" : "d716b1ff179f5b4248a1133641b6f0a4733a9e19",
       "triggerType" : "PUSH"
     }, {
       "hash" : "4e51ffc289a42a5e77afc15038bf4c36b7991316",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1425",
       "triggerID" : "4e51ffc289a42a5e77afc15038bf4c36b7991316",
       "triggerType" : "PUSH"
     }, {
       "hash" : "216b86cf20cccbc2462b36c8edc5b5a396ebd3c0",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1646",
       "triggerID" : "216b86cf20cccbc2462b36c8edc5b5a396ebd3c0",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ab5e8324f0ace63d1e5b3f292dd6d517b056fd21 UNKNOWN
   * 216b86cf20cccbc2462b36c8edc5b5a396ebd3c0 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=1646) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-617042256


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7841",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161201647",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "CANCELED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161221412",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7856",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "PENDING",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162139302",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=276",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 5a26fbb56d996236c296328a6d673bc01982be5f Travis: [CANCELED](https://travis-ci.com/github/flink-ci/flink/builds/161221412) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7856) 
   * ab5e8324f0ace63d1e5b3f292dd6d517b056fd21 UNKNOWN
   * 6e097b629bafde50b88d261cd856d624cf6f89c5 Travis: [PENDING](https://travis-ci.com/github/flink-ci/flink/builds/162139302) Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=276) 
   * 2ca466db8ef9f2c9ef74cdd830078610dd13506a UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on issue #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-617042256


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7841",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "PENDING",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161201647",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * c369785530aac75cb69c6445340f0684590921c1 Travis: [PENDING](https://travis-ci.com/github/flink-ci/flink/builds/161201647) Azure: [PENDING](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7841) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-617042256


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7841",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161201647",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161221412",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7856",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162139302",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=276",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162146799",
       "triggerID" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=282",
       "triggerID" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "status" : "FAILURE",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162154842",
       "triggerID" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=285",
       "triggerID" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ab5e8324f0ace63d1e5b3f292dd6d517b056fd21 UNKNOWN
   * 2c1df7529825b6a0af7e57d29febeade36a758b1 Travis: [FAILURE](https://travis-ci.com/github/flink-ci/flink/builds/162154842) Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=285) 
   * d1a93165bb5e47b2b6b2dd680c404722af7ca039 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] zentol commented on pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
zentol commented on pull request #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-623436107


   I'm currently waiting on more input from the ML before continuing the review.
   
   In the mean time, I have an idea on how to solve the issue of stdout/logging going into the same file, and I'm curious whether you think it might work.
   So far we tried to tackle the problem by changing _where_ the Flink process writes output to (stream redirections), or redirecting the console output (tee).
   What if the Flink process wouldn't output _anything_ to the console instead writing everything to the files as usual, but we run a separate program that reads back the .out/.log files?
   Basically, `exec <flink process stuff> | <file reader priting .log/.out files>`.
   
   The finicky thing is figuring out which files to read, but we know the names when the process starts, so it should be _feasible_ at least?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] zentol commented on pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
zentol commented on pull request #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-625113600


   Of course the `ConsoleAppender` is a better approach, there's no doubt about that. My idea was purely for the case where we _absolutely_ want to keep the log/stdout files separate.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-617042256


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7841",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c369785530aac75cb69c6445340f0684590921c1",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161201647",
       "triggerID" : "c369785530aac75cb69c6445340f0684590921c1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/161221412",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7856",
       "triggerID" : "5a26fbb56d996236c296328a6d673bc01982be5f",
       "triggerType" : "PUSH"
     }, {
       "hash" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "ab5e8324f0ace63d1e5b3f292dd6d517b056fd21",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162139302",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=276",
       "triggerID" : "6e097b629bafde50b88d261cd856d624cf6f89c5",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162146799",
       "triggerID" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=282",
       "triggerID" : "2ca466db8ef9f2c9ef74cdd830078610dd13506a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162154842",
       "triggerID" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=285",
       "triggerID" : "2c1df7529825b6a0af7e57d29febeade36a758b1",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=349",
       "triggerID" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "triggerType" : "PUSH"
     }, {
       "hash" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/162357202",
       "triggerID" : "d1a93165bb5e47b2b6b2dd680c404722af7ca039",
       "triggerType" : "PUSH"
     }, {
       "hash" : "bcaf191ee0597926ea740092596b34e82592a850",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "bcaf191ee0597926ea740092596b34e82592a850",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ab5e8324f0ace63d1e5b3f292dd6d517b056fd21 UNKNOWN
   * d1a93165bb5e47b2b6b2dd680c404722af7ca039 Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/162357202) Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=349) 
   * bcaf191ee0597926ea740092596b34e82592a850 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] wangyang0918 commented on a change in pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
wangyang0918 commented on a change in pull request #11839:
URL: https://github.com/apache/flink/pull/11839#discussion_r415203145



##########
File path: flink-runtime/src/main/java/org/apache/flink/runtime/util/StdOutErrRedirector.java
##########
@@ -0,0 +1,199 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.runtime.util;
+
+import org.apache.flink.annotation.VisibleForTesting;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.PrintStream;
+
+/**
+ * Redirect std out and std err to logger.
+ */
+public class StdOutErrRedirector {
+
+	private static final String STD_OUT_FILE_PROPERTY_KEY = "stdout.file";
+	private static final String STD_ERR_FILE_PROPERTY_KEY = "stderr.file";
+
+	private static final String STD_OUT_LOGGER_NAME = "StdOutErrRedirector.StdOut";
+	private static final String STD_ERR_LOGGER_NAME = "StdOutErrRedirector.StdErr";
+
+	private static final Logger STD_OUT_LOGGER = LoggerFactory.getLogger(STD_OUT_LOGGER_NAME);
+	private static final Logger STD_ERR_LOGGER = LoggerFactory.getLogger(STD_ERR_LOGGER_NAME);
+
+	private static final ThreadLocal<Boolean> isRedirecting = ThreadLocal.withInitial(() -> false);
+
+	/**
+	 * Try to redirect stdout and stderr.
+	 */
+	public static void redirectStdOutErr() {
+		if (System.getProperty(STD_OUT_FILE_PROPERTY_KEY) != null) {
+			System.setOut(createLoggerProxy(STD_OUT_LOGGER, System.out));
+		}
+
+		if (System.getProperty(STD_ERR_FILE_PROPERTY_KEY) != null) {
+			System.setErr(createLoggerProxy(STD_ERR_LOGGER, System.err));
+		}
+	}
+
+	/**
+	 * Create logger proxy print stream.
+	 * Do not check null, keep the same behavior with System.out/err.
+	 *
+	 * @param originalPrintStream the original print stream
+	 * @return the proxy print stream
+	 */
+	@VisibleForTesting
+	static PrintStream createLoggerProxy(final Logger logger, final PrintStream originalPrintStream) {

Review comment:
       Nice suggestion. I will fix it.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] wangyang0918 edited a comment on pull request #11839: [FLINK-17166][dist] Modify the log4j-console.properties to also output logs into the files for WebUI

Posted by GitBox <gi...@apache.org>.
wangyang0918 edited a comment on pull request #11839:
URL: https://github.com/apache/flink/pull/11839#issuecomment-619471329


   @zentol Thanks a lot for your review.
   
   I agree with you that introducing the stream redirections may take some problems. So we need to be very careful to enable the redirection via `StdOutErrRedirector.redirectStdOutErr`. Currently, i only see the requirements when we want to output the stdout/err to log files and console at the same time. Also i do not have seen a better solution. Using the `tee` will make us have to use the `grep` to filter out the log4j loggings. Just as the discussion in the [ticket](https://issues.apache.org/jira/browse/FLINK-17166?focusedCommentId=17087643&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17087643).
   
   Not all entrypoints need to do redirect the streams. Currently, i think only the docker environment deployment need(e.g. standalone, K8s). We could put it in the first line in the main of `XXXEntrypoint` and i do not find a logging system cache problem here. As you have said that the logging framework will cache the `OutputStream` at creation time, could you share me more insights here?
   
   The most important concerns when i have to introduce the stream redirection is not about the mixing the `.out` and `.err` file. It is we have to filter out the log4j logging from the stdout/err when using `tee`. And the filtering is not a stable and good solution.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org