-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
control-service: add custom logback-spring.xml config #111
Conversation
Please Describe the aim of the change and why it is needed (as per the template recommendations 😄 ) I have some concerns about the solution but I'd like to understand first what is the aim of the change and then it may be clearer why this was the chosen approach. |
a651ad7
to
a76e88e
Compare
The aim of the change is described in this sentence only. The rest is very useful information describing the alternative approaches. It's great that it's here. Can you expand it a bit. What do you mean "need to be able to send logs from control plane to a remote host" What logs, what remote host, why do we need to do that? |
a76e88e
to
07c8ecd
Compare
Thanks for expanding the PR/commit message. My concerns are is one we are making the helm chart configuration more complex. Is this a common enough use case that it needs to be visible at helm chart level ? Any configuration exposed in values.yaml of the helm chart can be thought of as a contract between us and our users that we need to support. The second thing is. Is logback configuration the right interface? What happens if we change the logging backend to Log4J or some other logging implementation? Beyond those two concerns, I have some notes about the current implementation that I'd make in the review but we can ignore them for now until we clear those 2 things |
...trol-service/projects/helm_charts/pipelines-control-service/templates/logging_configmap.yaml
Outdated
Show resolved
Hide resolved
projects/control-service/projects/helm_charts/pipelines-control-service/values.yaml
Outdated
Show resolved
Hide resolved
projects/control-service/projects/helm_charts/pipelines-control-service/values.yaml
Outdated
Show resolved
Hide resolved
Thanks for the feedback. I will try to address both concerns and maybe we can think of what to do next. One of the options would be to stick with this variant, the other option is to add the xml file directly in our super collider repo and add a reference to it in the shell script that builds the control plane container. My main concern with that one is passing an xml file to the EXTRA_JAVA_OPTS variable. Since we will need to reference a file in the EXTRA_JAVA_OPTS. Is that possible, do we need to pass the file to the container somehow? This is why IMO the easiest option was to include it in the helm charts. Another variant is to add a logback xml configuration file in the control-service project which will have to have the appender which sends data to a remote host. However this will change current logging behavior for all users. To address the feedback:
Let me know how to proceed with this change. Should we pursue changing the helm chart, or choose one of the different options outlined above |
Currently in Kuberenetes environment recommendations are that application log to stdout/stderr and separate log collection service (like fluentd ) which would read the logs and forward them toward remote host. But this can be expensive as fluentd operator need to be installed .
That's pretty valid case - but it's solved easily though environment variables. (--set extraEnvVars.LOGGING_LEVEL_COM_VMWARE_TAURUS=DEBUG as we do in our demo installation) I think this is spring-based variable, not logback (hence it would work even if we change the backend.
The problem here is not what we need to change. Changing our implementation is easy. The issue is that all of the customers that have custom logback based configuration - now would be broken. First is that a big problem? How likely is logback to change? Can we avoid that potential issue? slf4j (http://www.slf4j.org/) is meant to be a facade over the actual logging implementation. Is it possible to use it in some way here? Also how does spring handle this problem ? They enable users to pick their own logging backend, right?
I am not sure yet, The helm chart seems the only practical option. But let's research if there's some alternative that doesn't make us depend on logback. |
The problem we need to solve is how to enable syslog appender in some installations, right ? Alternative I think it is to reduce the scope of the change. Just as you mentioned we can add syslog appender in our logback.xml If they are not set (which would be default) , syslog appender would be disabled. If they are set , it would be enabled. |
Logging implementations
Logback is the default starter implementation https://docs.spring.io/spring-boot/docs/2.5.3/reference/htmlsingle/#features.logging . Also: Using ENV variable Using K8s volume to mount |
07c8ecd
to
b629dce
Compare
...cts/control-service/projects/pipelines_control_service/src/main/resources/logback-spring.xml
Outdated
Show resolved
Hide resolved
...cts/control-service/projects/pipelines_control_service/src/main/resources/logback-spring.xml
Outdated
Show resolved
Hide resolved
Why: Recently we have had problems with deployment of data jobs. Currently the control service only sends logs to the container's stdout stream. This meant that deployment errors could be lost due to log rolling. We have decided as a team to start sending logs to log insight. This introduces a change that enables us to do so. What:Added a logback-spring.xml file which contains the properties for logging. By default we will send logs to stdout still. However, we now check if a particular environment variable is present and if it is we also send logs to the host provided in the environment var. Testing: Tested starting the service locally with and without the specified env variable. Logs appear in loginsight when variable is present. In both cases logs appear in stdout. Signed-off-by: Momchil Zhivkov <[email protected]>
address comments. Signed-off-by: mrMoZ1 <[email protected]>
a343750
to
84b96c8
Compare
control-service: Enable sending logs to log insight.
Why: Recently we have had problems with deployment of data jobs.
Currently the control service only sends logs to the container's
stdout stream. This meant that deployment errors could be lost
due to log rolling. We have decided as a team to start sending
logs to log insight. This introduces a change that enables us
to do so.
What:Added a logback-spring.xml file which contains the properties
for logging. By default we will send logs to stdout still. However,
we now check if a particular environment variable is present and if
it is we also send logs to the host provided in the environment var.
Testing: Tested starting the service locally with and without the
specified env variable. Logs appear in loginsight when variable is
present. In both cases logs appear in stdout.
Signed-off-by: Momchil Zhivkov [email protected]