[jira] [Commented] (ZOOKEEPER-4757) Support JSON format logging

2023-10-14 Thread Andor Molnar (Jira)


[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-4757?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17775156#comment-17775156
 ] 

Andor Molnar commented on ZOOKEEPER-4757:
-

I rather build a wrapper Maven project which contains the custom logback.xml 
and pulls the required dependencies.

I don't think we need to add anything to the codebase in this manner.

> Support JSON format logging
> ---
>
> Key: ZOOKEEPER-4757
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-4757
> Project: ZooKeeper
>  Issue Type: Improvement
>Reporter: Jan Høydahl
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 2h 50m
>  Remaining Estimate: 0h
>
> More and more enterprise users request structured JSON format logging for 
> their applications. This removes the need for configuring custom log line 
> parsers for every application when collecting logs centrally.
> Zookeeper has flexible logging through Slf4j and Logback, for which there are 
> several ways to achieve JSON logging. But for end users (such as helm chart 
> user) it is very difficult to achieve. It should ideally be as simple as a 
> configuration option.
> OpenTelemetry is a CNCF project that has become the defacto standard for 
> metrics and traces collection. They also cover logging, and they recently 
> [standardized on ECS JSON 
> format|https://opentelemetry.io/blog/2023/ecs-otel-semconv-convergence/] as 
> their log schema for OTEL-logging. Although there are other JSON formats in 
> use, a pragmatic option for zookeeper is to only support ECS.
> Proposed way to enable JSON logging:
> {code:java}
> export ZOO_LOG_FORMAT=json
> bin/zkServer.sh start-foreground{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (ZOOKEEPER-4757) Support JSON format logging

2023-10-13 Thread Jira


[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-4757?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17774903#comment-17774903
 ] 

Jan Høydahl commented on ZOOKEEPER-4757:


> What do you mean exactly by 'Maven can help keep versions' and why is it an 
> advantage over a docker project?
 
Dockerfile is not particaulary suited for pulling jar files. You end up with 
wget from mvnrepo or similar and no dependabot support or similar for staying 
up to date. Let's see what downstream says.
 
Is there anything at all from my PR you want to accept? Docs with pointers? 
Commented-out appender?

> Support JSON format logging
> ---
>
> Key: ZOOKEEPER-4757
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-4757
> Project: ZooKeeper
>  Issue Type: Improvement
>Reporter: Jan Høydahl
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 2.5h
>  Remaining Estimate: 0h
>
> More and more enterprise users request structured JSON format logging for 
> their applications. This removes the need for configuring custom log line 
> parsers for every application when collecting logs centrally.
> Zookeeper has flexible logging through Slf4j and Logback, for which there are 
> several ways to achieve JSON logging. But for end users (such as helm chart 
> user) it is very difficult to achieve. It should ideally be as simple as a 
> configuration option.
> OpenTelemetry is a CNCF project that has become the defacto standard for 
> metrics and traces collection. They also cover logging, and they recently 
> [standardized on ECS JSON 
> format|https://opentelemetry.io/blog/2023/ecs-otel-semconv-convergence/] as 
> their log schema for OTEL-logging. Although there are other JSON formats in 
> use, a pragmatic option for zookeeper is to only support ECS.
> Proposed way to enable JSON logging:
> {code:java}
> export ZOO_LOG_FORMAT=json
> bin/zkServer.sh start-foreground{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (ZOOKEEPER-4757) Support JSON format logging

2023-10-13 Thread Andor Molnar (Jira)


[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-4757?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17774883#comment-17774883
 ] 

Andor Molnar commented on ZOOKEEPER-4757:
-

{quote} I have contacted both those downstream projects with similar requests, 
...
{quote}
That makes perfect sense to me. I think such addition would be better fit for a 
ZooKeeper docker project.
{quote}...I still feel the best place to add this convenience feature is 
upstream where Maven can help keep versions in sync etc.
{quote}
What do you mean exactly by 'Maven can help keep versions' and why is it an 
advantage over a docker project?

> Support JSON format logging
> ---
>
> Key: ZOOKEEPER-4757
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-4757
> Project: ZooKeeper
>  Issue Type: Improvement
>Reporter: Jan Høydahl
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 2.5h
>  Remaining Estimate: 0h
>
> More and more enterprise users request structured JSON format logging for 
> their applications. This removes the need for configuring custom log line 
> parsers for every application when collecting logs centrally.
> Zookeeper has flexible logging through Slf4j and Logback, for which there are 
> several ways to achieve JSON logging. But for end users (such as helm chart 
> user) it is very difficult to achieve. It should ideally be as simple as a 
> configuration option.
> OpenTelemetry is a CNCF project that has become the defacto standard for 
> metrics and traces collection. They also cover logging, and they recently 
> [standardized on ECS JSON 
> format|https://opentelemetry.io/blog/2023/ecs-otel-semconv-convergence/] as 
> their log schema for OTEL-logging. Although there are other JSON formats in 
> use, a pragmatic option for zookeeper is to only support ECS.
> Proposed way to enable JSON logging:
> {code:java}
> export ZOO_LOG_FORMAT=json
> bin/zkServer.sh start-foreground{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (ZOOKEEPER-4757) Support JSON format logging

2023-10-13 Thread Jira


[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-4757?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17774842#comment-17774842
 ] 

Jan Høydahl commented on ZOOKEEPER-4757:


As a committer I'm well aware that projects are not obliged to anything else 
than publishing the source code tarball. You will find among ASF projects 
different levels of commitment to the end users. Some projects rely on 
downstream companies taking care of user fridendly packaging, documentation, 
docker etc. Others (like e.g. Solr where I'm a committer) have chosen to 
include an official, hardened Dockerfile as part of the project  (which end 
users can tweak if they like), and accepted the incubation of the solr-operator 
as well. There have been proposals for maintaining RPM/DEB packages too but we 
don't do that as no committers can commit to :) maintaining such.

The zookeeper project seems to lack a clear downstream re-packager. I applaud 
the volunteer initiative of publishing the Zookeeper docker image, hardening 
the upstream experience with additional env.vars and documentation; it helps a 
lot. Earlier, [Pravega|https://github.com/pravega/zookeeper-operator] did a 
great job on production ready Zookeeper Operator with their own repackaged ZK 
docker image, but sadly that project is dying. Bitnami still does a great job 
with the ZK helmchart, so not all is dark, though fragmented. I have contacted 
both those downstream projects with similar requests, however I still feel the 
best place to add this convenience feature is upstream where Maven can help 
keep versions in sync etc.

But it is of course up to you to accept or reject the contribution.

> Support JSON format logging
> ---
>
> Key: ZOOKEEPER-4757
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-4757
> Project: ZooKeeper
>  Issue Type: Improvement
>Reporter: Jan Høydahl
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 2.5h
>  Remaining Estimate: 0h
>
> More and more enterprise users request structured JSON format logging for 
> their applications. This removes the need for configuring custom log line 
> parsers for every application when collecting logs centrally.
> Zookeeper has flexible logging through Slf4j and Logback, for which there are 
> several ways to achieve JSON logging. But for end users (such as helm chart 
> user) it is very difficult to achieve. It should ideally be as simple as a 
> configuration option.
> OpenTelemetry is a CNCF project that has become the defacto standard for 
> metrics and traces collection. They also cover logging, and they recently 
> [standardized on ECS JSON 
> format|https://opentelemetry.io/blog/2023/ecs-otel-semconv-convergence/] as 
> their log schema for OTEL-logging. Although there are other JSON formats in 
> use, a pragmatic option for zookeeper is to only support ECS.
> Proposed way to enable JSON logging:
> {code:java}
> export ZOO_LOG_FORMAT=json
> bin/zkServer.sh start-foreground{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (ZOOKEEPER-4757) Support JSON format logging

2023-10-12 Thread Andor Molnar (Jira)


[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-4757?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17774421#comment-17774421
 ] 

Andor Molnar commented on ZOOKEEPER-4757:
-

{quote}...it is possible to build your own Docker image which downloads 
additional JAR files from the web
{quote}
You have to do this anyway. Maybe there's a confusion here: I know there's a 
ZooKeeper [docker image|https://hub.docker.com/_/zookeeper] on Docker Hub which 
calls itself "official", but this is not maintained by the ZooKeeper community, 
hence it's _not an official image._ Maybe we should to something about it, I 
don't know.

Apache ZooKeeper community already ships convenience jar (binary), which is 
against ASF's strict policies. If we look from that point of view, the one and 
only Apache ZooKeeper artifact, which is maintained and delivered by us, is the 
{_}source package{_}.

The above mentioned docker image could be a good example, but I strongly 
against building production systems based on that. Create your own one with 
your own logging setup.

The second patch (PR #2077) adds additional dependencies to zookeeper-server 
too, so I doubt that [~ctubbsii] will like it, but I'm waiting for his own 
thoughts.

> Support JSON format logging
> ---
>
> Key: ZOOKEEPER-4757
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-4757
> Project: ZooKeeper
>  Issue Type: Improvement
>Reporter: Jan Høydahl
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 2.5h
>  Remaining Estimate: 0h
>
> More and more enterprise users request structured JSON format logging for 
> their applications. This removes the need for configuring custom log line 
> parsers for every application when collecting logs centrally.
> Zookeeper has flexible logging through Slf4j and Logback, for which there are 
> several ways to achieve JSON logging. But for end users (such as helm chart 
> user) it is very difficult to achieve. It should ideally be as simple as a 
> configuration option.
> OpenTelemetry is a CNCF project that has become the defacto standard for 
> metrics and traces collection. They also cover logging, and they recently 
> [standardized on ECS JSON 
> format|https://opentelemetry.io/blog/2023/ecs-otel-semconv-convergence/] as 
> their log schema for OTEL-logging. Although there are other JSON formats in 
> use, a pragmatic option for zookeeper is to only support ECS.
> Proposed way to enable JSON logging:
> {code:java}
> export ZOO_LOG_FORMAT=json
> bin/zkServer.sh start-foreground{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (ZOOKEEPER-4757) Support JSON format logging

2023-10-12 Thread Jira


[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-4757?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17774394#comment-17774394
 ] 

Jan Høydahl commented on ZOOKEEPER-4757:


Hi, thanks for the feedback. Yes, my motivation is to cater for the 
cloud-native use case. You are correct that it is possible to build your own 
Docker image which downloads additional JAR files from the web, places then im 
the correct lib folder in the docker image, overlays a different logback config 
file and then push that docker image to hub and use it in place of the default 
one.

Another option is to add those custom libs to an init container image and copy 
them into the default zk container during startup, or mount them in somehow.

None of these are simple or practical ways to simply enable JSON logging. It 
adds additional custom deploy infrastructure.

Given the fact that this seems to be a more and more common request, and the 
small footprint of the fix I feel we can help downstream cloud-native users by 
shipping an example.

Please see PR #2077 for a less intrusive implementation proposal where we only 
add the dependency jar and an example appender, no new env vars or code changes.

> Support JSON format logging
> ---
>
> Key: ZOOKEEPER-4757
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-4757
> Project: ZooKeeper
>  Issue Type: Improvement
>Reporter: Jan Høydahl
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 2.5h
>  Remaining Estimate: 0h
>
> More and more enterprise users request structured JSON format logging for 
> their applications. This removes the need for configuring custom log line 
> parsers for every application when collecting logs centrally.
> Zookeeper has flexible logging through Slf4j and Logback, for which there are 
> several ways to achieve JSON logging. But for end users (such as helm chart 
> user) it is very difficult to achieve. It should ideally be as simple as a 
> configuration option.
> OpenTelemetry is a CNCF project that has become the defacto standard for 
> metrics and traces collection. They also cover logging, and they recently 
> [standardized on ECS JSON 
> format|https://opentelemetry.io/blog/2023/ecs-otel-semconv-convergence/] as 
> their log schema for OTEL-logging. Although there are other JSON formats in 
> use, a pragmatic option for zookeeper is to only support ECS.
> Proposed way to enable JSON logging:
> {code:java}
> export ZOO_LOG_FORMAT=json
> bin/zkServer.sh start-foreground{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (ZOOKEEPER-4757) Support JSON format logging

2023-10-12 Thread Andor Molnar (Jira)


[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-4757?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17774386#comment-17774386
 ] 

Andor Molnar commented on ZOOKEEPER-4757:
-

[~janhoy] 

I tend to agree with [~ctubbsii] . Please correct me if I'm wrong but is there 
any other reason behind this patch then making the life of docker/helm ops 
easier?

What's the use case exactly? JSON logging can be enabled by providing a 
customized logback / log4j2 configuration and adding the required dependencies 
to the classpath. I don't think ZooKeeper has to be rebuilt for this, but I 
need to double check?

Chris is right, making devops life easier alone is not a good reason for adding 
additional dependencies to vanilla ZooKeeper.

 

 

> Support JSON format logging
> ---
>
> Key: ZOOKEEPER-4757
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-4757
> Project: ZooKeeper
>  Issue Type: Improvement
>Reporter: Jan Høydahl
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 2.5h
>  Remaining Estimate: 0h
>
> More and more enterprise users request structured JSON format logging for 
> their applications. This removes the need for configuring custom log line 
> parsers for every application when collecting logs centrally.
> Zookeeper has flexible logging through Slf4j and Logback, for which there are 
> several ways to achieve JSON logging. But for end users (such as helm chart 
> user) it is very difficult to achieve. It should ideally be as simple as a 
> configuration option.
> OpenTelemetry is a CNCF project that has become the defacto standard for 
> metrics and traces collection. They also cover logging, and they recently 
> [standardized on ECS JSON 
> format|https://opentelemetry.io/blog/2023/ecs-otel-semconv-convergence/] as 
> their log schema for OTEL-logging. Although there are other JSON formats in 
> use, a pragmatic option for zookeeper is to only support ECS.
> Proposed way to enable JSON logging:
> {code:java}
> export ZOO_LOG_FORMAT=json
> bin/zkServer.sh start-foreground{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (ZOOKEEPER-4757) Support JSON format logging

2023-10-11 Thread Christopher Tubbs (Jira)


[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-4757?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17774138#comment-17774138
 ] 

Christopher Tubbs commented on ZOOKEEPER-4757:
--

ZooKeeper has taken steps to use SLF4J as its logging framework, and has chosen 
to use logback as the default runtime implementation, and ships with a logback 
configuration file as a reference implementation.

The current status quo should suffice. I do not think that the ZooKeeper 
project should take additional steps to try to accommodate specific 
customizations to the logging, since the whole point of using SLF4J is that it 
is completely pluggable and configurable by users.

If a user needs a specific customization, they just need to:

1. Provide a user-supplied logback configuration rather than the default one 
that ships, OR
2. Replace the slf4j logging runtime with a different logging runtime, such as 
log4j or another of their choosing, and supply a config file appropriate for 
that runtime

It should not be necessary for ZooKeeper itself to do anything to support this, 
since it is already supported by the choice to use a highly-customizable 
logging framework so users can customize according to their hearts' desire.


> Support JSON format logging
> ---
>
> Key: ZOOKEEPER-4757
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-4757
> Project: ZooKeeper
>  Issue Type: Improvement
>Reporter: Jan Høydahl
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> More and more enterprise users request structured JSON format logging for 
> their applications. This removes the need for configuring custom log line 
> parsers for every application when collecting logs centrally.
> Zookeeper has flexible logging through Slf4j and Logback, for which there are 
> several ways to achieve JSON logging. But for end users (such as helm chart 
> user) it is very difficult to achieve. It should ideally be as simple as a 
> configuration option.
> OpenTelemetry is a CNCF project that has become the defacto standard for 
> metrics and traces collection. They also cover logging, and they recently 
> [standardized on ECS JSON 
> format|https://opentelemetry.io/blog/2023/ecs-otel-semconv-convergence/] as 
> their log schema for OTEL-logging. Although there are other JSON formats in 
> use, a pragmatic option for zookeeper is to only support ECS.
> Proposed way to enable JSON logging:
> {code:java}
> export ZOO_LOG_FORMAT=json
> bin/zkServer.sh start-foreground{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)