You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "showuon (via GitHub)" <gi...@apache.org> on 2024/11/08 12:39:50 UTC
[PR] [FLINK-36192][log] instruct how to change log level dynamically [flink-kubernetes-operator]
showuon opened a new pull request, #911:
URL: https://github.com/apache/flink-kubernetes-operator/pull/911
<!--
*Thank you very much for contributing to the Apache Flink Kubernetes Operator - we are happy that you want to help us improve the project. 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.*
## 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 read more on how we use GitHub Actions for CI [here](https://nightlies.apache.org/flink/flink-kubernetes-operator-docs-main/docs/development/guide/#cicd).
- 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
In the [doc](https://nightlies.apache.org/flink/flink-kubernetes-operator-docs-main/docs/operations/metrics-logging/#logging), we didn't explicitly instruct users how to change log level dynamically for operator/job manager/task manager. This is important for troubleshooting, and it is already built-in config in Flink core.
## Brief change log
- In `log4j-console.properties` and `log4j-operator.properties` in Helm, added a hint to demo how to set config to change config dynamically.
- In the [doc](https://nightlies.apache.org/flink/flink-kubernetes-operator-docs-main/docs/operations/metrics-logging/#logging), added a hint to demo how to set config to change config dynamically.
## Verifying this change
<!--
Please make sure both new and modified tests in this PR follows the conventions defined in our code quality guide: https://flink.apache.org/contributing/code-style-and-quality-common.html#testing
-->
This change is a trivial rework / code cleanup without any test coverage.
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): no
- The public API, i.e., is any changes to the `CustomResourceDescriptors`: no
- Core observer or reconciler logic that is regularly executed: no
## Documentation
- Does this pull request introduce a new feature? no
- If yes, how is the feature documented? not applicable
--
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.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-36192][log] instruct how to change log level dynamically [flink-kubernetes-operator]
Posted by "showuon (via GitHub)" <gi...@apache.org>.
showuon commented on PR #911:
URL: https://github.com/apache/flink-kubernetes-operator/pull/911#issuecomment-2478740181
@mxm , thanks for the comments. PR updated. Please take a look again. Thanks.
--
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.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-36192][log] instruct how to change log level dynamically [flink-kubernetes-operator]
Posted by "showuon (via GitHub)" <gi...@apache.org>.
showuon commented on code in PR #911:
URL: https://github.com/apache/flink-kubernetes-operator/pull/911#discussion_r1835839561
##########
helm/flink-kubernetes-operator/conf/log4j-console.properties:
##########
@@ -60,3 +60,6 @@ appender.rolling.strategy.max = 10
# Suppress the irrelevant (wrong) warnings from the Netty channel handler
logger.netty.name = org.apache.flink.shaded.akka.org.jboss.netty.channel.DefaultChannelPipeline
logger.netty.level = OFF
+
+# Uncomment this if you want to allow dynamically change logging level
+# monitorInterval = 30
Review Comment:
Question: Should we enable it by default?
Same question to `log4j-operator.properties`.
--
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.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-36192][log] instruct how to change log level dynamically [flink-kubernetes-operator]
Posted by "showuon (via GitHub)" <gi...@apache.org>.
showuon commented on PR #911:
URL: https://github.com/apache/flink-kubernetes-operator/pull/911#issuecomment-2478220472
@gyfora @mxm , please help take a look when available. Thanks.
--
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.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-36192][log] instruct how to change log level dynamically [flink-kubernetes-operator]
Posted by "showuon (via GitHub)" <gi...@apache.org>.
showuon commented on code in PR #911:
URL: https://github.com/apache/flink-kubernetes-operator/pull/911#discussion_r1835936114
##########
docs/content/docs/operations/helm.md:
##########
@@ -56,6 +56,10 @@ To override single parameters you can use `--set`, for example:
```
helm install --set image.repository=apache/flink-kubernetes-operator --set image.tag={{< stable >}}{{< version >}}{{< /stable >}}{{< unstable >}}latest{{< /unstable >}} flink-kubernetes-operator helm/flink-kubernetes-operator
```
+Note, you should remember to escape some special characters in your `--set` lines, for example:
+```
+helm install --set defaultConfiguration."log4j-operator\.properties"=rootLogger.level\=DEBUG flink-kubernetes-operator helm/flink-kubernetes-operator
+```
Review Comment:
You're right! Will do!
--
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.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-36192][log] instruct how to change log level dynamically [flink-kubernetes-operator]
Posted by "showuon (via GitHub)" <gi...@apache.org>.
showuon commented on code in PR #911:
URL: https://github.com/apache/flink-kubernetes-operator/pull/911#discussion_r1835934912
##########
docs/content/docs/operations/helm.md:
##########
@@ -56,6 +56,10 @@ To override single parameters you can use `--set`, for example:
```
helm install --set image.repository=apache/flink-kubernetes-operator --set image.tag={{< stable >}}{{< version >}}{{< /stable >}}{{< unstable >}}latest{{< /unstable >}} flink-kubernetes-operator helm/flink-kubernetes-operator
```
+Note, you should remember to escape some special characters in your `--set` lines, for example:
+```
+helm install --set defaultConfiguration."log4j-operator\.properties"=rootLogger.level\=DEBUG flink-kubernetes-operator helm/flink-kubernetes-operator
Review Comment:
Unfortunately, it won't work.
--
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.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-36192][log] instruct how to change log level dynamically [flink-kubernetes-operator]
Posted by "showuon (via GitHub)" <gi...@apache.org>.
showuon commented on code in PR #911:
URL: https://github.com/apache/flink-kubernetes-operator/pull/911#discussion_r1835882260
##########
docs/content/docs/operations/helm.md:
##########
@@ -56,6 +56,10 @@ To override single parameters you can use `--set`, for example:
```
helm install --set image.repository=apache/flink-kubernetes-operator --set image.tag={{< stable >}}{{< version >}}{{< /stable >}}{{< unstable >}}latest{{< /unstable >}} flink-kubernetes-operator helm/flink-kubernetes-operator
```
+Note, you should remember to escape some special characters in your `--set` lines, for example:
+```
+helm install flink-kubernetes-operator flink-operator-repo/flink-kubernetes-operator --set defaultConfiguration."log4j-operator\.properties"=rootLogger.level\=DEBUG
+```
Review Comment:
This took me some time to figure it out. I think it'd be great if we explicitly document 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.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-36192][log] instruct how to change log level dynamically [flink-kubernetes-operator]
Posted by "mxm (via GitHub)" <gi...@apache.org>.
mxm commented on code in PR #911:
URL: https://github.com/apache/flink-kubernetes-operator/pull/911#discussion_r1843399317
##########
helm/flink-kubernetes-operator/conf/log4j-operator.properties:
##########
@@ -32,3 +32,5 @@ logger.conf.level = WARN
# Avoid logging fallback key INFO messages
logger.conf.name = org.apache.flink.configuration.Configuration
logger.conf.level = WARN
+
+monitorInterval = 30
Review Comment:
I think we should disable automatic reloading by default.
##########
helm/flink-kubernetes-operator/conf/log4j-console.properties:
##########
@@ -60,3 +60,5 @@ appender.rolling.strategy.max = 10
# Suppress the irrelevant (wrong) warnings from the Netty channel handler
logger.netty.name = org.apache.flink.shaded.akka.org.jboss.netty.channel.DefaultChannelPipeline
logger.netty.level = OFF
+
+monitorInterval = 30
Review Comment:
What's the interval? Seconds? Can we add this in a comment which also explains what this does?
##########
helm/flink-kubernetes-operator/conf/log4j-operator.properties:
##########
@@ -32,3 +32,5 @@ logger.conf.level = WARN
# Avoid logging fallback key INFO messages
logger.conf.name = org.apache.flink.configuration.Configuration
logger.conf.level = WARN
+
+monitorInterval = 30
Review Comment:
What's the interval? Seconds? Can we add this in a comment which also explains what this does?
##########
helm/flink-kubernetes-operator/conf/log4j-console.properties:
##########
@@ -60,3 +60,5 @@ appender.rolling.strategy.max = 10
# Suppress the irrelevant (wrong) warnings from the Netty channel handler
logger.netty.name = org.apache.flink.shaded.akka.org.jboss.netty.channel.DefaultChannelPipeline
logger.netty.level = OFF
+
+monitorInterval = 30
Review Comment:
I think we should disable automatic reloading by default.
--
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.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-36192][log] instruct how to change log level dynamically [flink-kubernetes-operator]
Posted by "showuon (via GitHub)" <gi...@apache.org>.
showuon commented on code in PR #911:
URL: https://github.com/apache/flink-kubernetes-operator/pull/911#discussion_r1835882260
##########
docs/content/docs/operations/helm.md:
##########
@@ -56,6 +56,10 @@ To override single parameters you can use `--set`, for example:
```
helm install --set image.repository=apache/flink-kubernetes-operator --set image.tag={{< stable >}}{{< version >}}{{< /stable >}}{{< unstable >}}latest{{< /unstable >}} flink-kubernetes-operator helm/flink-kubernetes-operator
```
+Note, you should remember to escape some special characters in your `--set` lines, for example:
+```
+helm install flink-kubernetes-operator flink-operator-repo/flink-kubernetes-operator --set defaultConfiguration."log4j-operator\.properties"=rootLogger.level\=DEBUG
+```
Review Comment:
This took me some time to figure it out. I think it'd be great if we explicitly document it.
##########
docs/content/docs/operations/helm.md:
##########
@@ -56,6 +56,10 @@ To override single parameters you can use `--set`, for example:
```
helm install --set image.repository=apache/flink-kubernetes-operator --set image.tag={{< stable >}}{{< version >}}{{< /stable >}}{{< unstable >}}latest{{< /unstable >}} flink-kubernetes-operator helm/flink-kubernetes-operator
```
+Note, you should remember to escape some special characters in your `--set` lines, for example:
+```
+helm install --set defaultConfiguration."log4j-operator\.properties"=rootLogger.level\=DEBUG flink-kubernetes-operator helm/flink-kubernetes-operator
+```
Review Comment:
This took me some time to figure it out. I think it'd be great if we explicitly document 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.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-36192][log] instruct how to change log level dynamically [flink-kubernetes-operator]
Posted by "SamBarker (via GitHub)" <gi...@apache.org>.
SamBarker commented on code in PR #911:
URL: https://github.com/apache/flink-kubernetes-operator/pull/911#discussion_r1835935568
##########
docs/content/docs/operations/helm.md:
##########
@@ -56,6 +56,10 @@ To override single parameters you can use `--set`, for example:
```
helm install --set image.repository=apache/flink-kubernetes-operator --set image.tag={{< stable >}}{{< version >}}{{< /stable >}}{{< unstable >}}latest{{< /unstable >}} flink-kubernetes-operator helm/flink-kubernetes-operator
```
+Note, you should remember to escape some special characters in your `--set` lines, for example:
+```
+helm install --set defaultConfiguration."log4j-operator\.properties"=rootLogger.level\=DEBUG flink-kubernetes-operator helm/flink-kubernetes-operator
Review Comment:
Ohh ouch. There are two levels at play...
--
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.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-36192][log] instruct how to change log level dynamically [flink-kubernetes-operator]
Posted by "SamBarker (via GitHub)" <gi...@apache.org>.
SamBarker commented on code in PR #911:
URL: https://github.com/apache/flink-kubernetes-operator/pull/911#discussion_r1835937449
##########
docs/content.zh/docs/operations/metrics-logging.md:
##########
@@ -193,9 +193,13 @@ defaultConfiguration:
log4j-operator.properties: |+
# Flink Operator Logging Overrides
# rootLogger.level = DEBUG
+ # Uncomment this if you want to allow dynamically change logging level
+ # monitorInterval = 30
Review Comment:
Fair 😁
--
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.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-36192][log] instruct how to change log level dynamically [flink-kubernetes-operator]
Posted by "SamBarker (via GitHub)" <gi...@apache.org>.
SamBarker commented on code in PR #911:
URL: https://github.com/apache/flink-kubernetes-operator/pull/911#discussion_r1835897387
##########
docs/content/docs/operations/helm.md:
##########
@@ -56,6 +56,10 @@ To override single parameters you can use `--set`, for example:
```
helm install --set image.repository=apache/flink-kubernetes-operator --set image.tag={{< stable >}}{{< version >}}{{< /stable >}}{{< unstable >}}latest{{< /unstable >}} flink-kubernetes-operator helm/flink-kubernetes-operator
```
+Note, you should remember to escape some special characters in your `--set` lines, for example:
Review Comment:
```suggestion
Note, you should escape special characters in your `--set` lines, for example:
```
##########
helm/flink-kubernetes-operator/conf/log4j-console.properties:
##########
@@ -60,3 +60,6 @@ appender.rolling.strategy.max = 10
# Suppress the irrelevant (wrong) warnings from the Netty channel handler
logger.netty.name = org.apache.flink.shaded.akka.org.jboss.netty.channel.DefaultChannelPipeline
logger.netty.level = OFF
+
+# Uncomment this if you want to allow dynamically change logging level
+# monitorInterval = 30
Review Comment:
Yes probably as thats what people expect of configMaps for them to be editable and picked up without recreating the pod.
##########
docs/content/docs/operations/helm.md:
##########
@@ -56,6 +56,10 @@ To override single parameters you can use `--set`, for example:
```
helm install --set image.repository=apache/flink-kubernetes-operator --set image.tag={{< stable >}}{{< version >}}{{< /stable >}}{{< unstable >}}latest{{< /unstable >}} flink-kubernetes-operator helm/flink-kubernetes-operator
```
+Note, you should remember to escape some special characters in your `--set` lines, for example:
+```
+helm install --set defaultConfiguration."log4j-operator\.properties"=rootLogger.level\=DEBUG flink-kubernetes-operator helm/flink-kubernetes-operator
+```
Review Comment:
Should there be a similar note in `content.zh`?
##########
docs/content.zh/docs/operations/metrics-logging.md:
##########
@@ -193,9 +193,13 @@ defaultConfiguration:
log4j-operator.properties: |+
# Flink Operator Logging Overrides
# rootLogger.level = DEBUG
+ # Uncomment this if you want to allow dynamically change logging level
+ # monitorInterval = 30
Review Comment:
It looks like `monitorInterval` is specified in seconds, based on [this stackoverflow](https://stackoverflow.com/a/43949522/1389220) answer we can probably afford to suggest a shorter default.
##########
docs/content/docs/operations/helm.md:
##########
@@ -56,6 +56,10 @@ To override single parameters you can use `--set`, for example:
```
helm install --set image.repository=apache/flink-kubernetes-operator --set image.tag={{< stable >}}{{< version >}}{{< /stable >}}{{< unstable >}}latest{{< /unstable >}} flink-kubernetes-operator helm/flink-kubernetes-operator
```
+Note, you should remember to escape some special characters in your `--set` lines, for example:
+```
+helm install --set defaultConfiguration."log4j-operator\.properties"=rootLogger.level\=DEBUG flink-kubernetes-operator helm/flink-kubernetes-operator
Review Comment:
Would
```suggestion
helm install --set 'defaultConfiguration."log4j-operator.properties"=rootLogger.level=DEBUG flink-kubernetes-operator' helm/flink-kubernetes-operator
```
work? I think its easier to read and should prevent shell globbing running amok.
--
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.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-36192][log] instruct how to change log level dynamically [flink-kubernetes-operator]
Posted by "showuon (via GitHub)" <gi...@apache.org>.
showuon commented on code in PR #911:
URL: https://github.com/apache/flink-kubernetes-operator/pull/911#discussion_r1835936022
##########
docs/content.zh/docs/operations/metrics-logging.md:
##########
@@ -193,9 +193,13 @@ defaultConfiguration:
log4j-operator.properties: |+
# Flink Operator Logging Overrides
# rootLogger.level = DEBUG
+ # Uncomment this if you want to allow dynamically change logging level
+ # monitorInterval = 30
Review Comment:
I'm trying to be consistent with [flink core log4j.properties](https://github.com/apache/flink/blob/master/flink-dist/src/main/flink-bin/conf/log4j.properties#L20).
--
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.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-36192][log] instruct how to change log level dynamically [flink-kubernetes-operator]
Posted by "showuon (via GitHub)" <gi...@apache.org>.
showuon commented on code in PR #911:
URL: https://github.com/apache/flink-kubernetes-operator/pull/911#discussion_r1835936022
##########
docs/content.zh/docs/operations/metrics-logging.md:
##########
@@ -193,9 +193,13 @@ defaultConfiguration:
log4j-operator.properties: |+
# Flink Operator Logging Overrides
# rootLogger.level = DEBUG
+ # Uncomment this if you want to allow dynamically change logging level
+ # monitorInterval = 30
Review Comment:
I'm trying to be consistent with [flink core log4j.properties](https://github.com/apache/flink/blob/master/flink-dist/src/main/flink-bin/conf/log4j.properties#L20) 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.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-36192][log] instruct how to change log level dynamically [flink-kubernetes-operator]
Posted by "showuon (via GitHub)" <gi...@apache.org>.
showuon commented on code in PR #911:
URL: https://github.com/apache/flink-kubernetes-operator/pull/911#discussion_r1843712609
##########
helm/flink-kubernetes-operator/conf/log4j-operator.properties:
##########
@@ -32,3 +32,5 @@ logger.conf.level = WARN
# Avoid logging fallback key INFO messages
logger.conf.name = org.apache.flink.configuration.Configuration
logger.conf.level = WARN
+
+monitorInterval = 30
Review Comment:
It's in seconds. Updated.
--
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.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-36192][log] instruct how to change log level dynamically [flink-kubernetes-operator]
Posted by "mxm (via GitHub)" <gi...@apache.org>.
mxm merged PR #911:
URL: https://github.com/apache/flink-kubernetes-operator/pull/911
--
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.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org