Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Bookie does not show logs in 4.15.0rc0 #3165

Closed
eolivelli opened this issue Mar 31, 2022 · 10 comments
Closed

Bookie does not show logs in 4.15.0rc0 #3165

eolivelli opened this issue Mar 31, 2022 · 10 comments

Comments

@eolivelli
Copy link
Contributor

BUG REPORT

Describe the bug

It looks like in BK 4.15.0rc0 the bookie does not log anything.
We still have log4j1 configuration files in "conf" and we are not setting "log4j.configurationFile" (but log4j.configuration) in the shell scripts

https://logging.apache.org/log4j/2.x/manual/configuration.html

To Reproduce

Unpack the binary tarball and then run bin/bookkeeper localbookie 3

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

The logs show up

@shoothzj
Copy link
Member

shoothzj commented Apr 1, 2022

I change the params in common.sh, but it's still no log out

@eolivelli
Copy link
Contributor Author

According to the log4j2 documentation if we set the old system property log4j2 should behave like log41
https://logging.apache.org/log4j/2.x/manual/migration.html

image

@eolivelli
Copy link
Contributor Author

we could:

  • add the Log41 bridge (is is a separate jar?)
  • switch to reload4j
  • convert the configuration files to log4j2 format (YAML)

@eolivelli eolivelli added this to the 4.15.0 milestone Apr 1, 2022
@eolivelli
Copy link
Contributor Author

basically we should move forward with the work started here #2816

@shoothzj
Copy link
Member

shoothzj commented Apr 1, 2022

I suggest convert the configuration files to log4j2 format (YAML). I can work on this.

@hangc0276
Copy link
Contributor

This PR #2816 use log41 bridge to support log4j, and it works well. The root cause of can't log anything is introduced by #3130 . I'm working on fix it.

@RaulGracia
Copy link
Contributor

Thanks @hangc0276, I agree with you. I remember testing logging with PR #2816 and the follow-up PR #2837. Anyway, I just checked out the project on commit 6e3c82cbfba7e75b946075a65c16cb390c09f9a6 (PR #2837) and logging seems to be working fine:

$ bin/bookkeeper localbookie 1
2022-04-01T18:18:16,114 - INFO  - [main:LocalBookKeeper@458] - Using configuration file /home/raul/Documents/workspace/bookkeeper-log4j2-config-issue/bookkeeper/bookkeeper-dist/server/target/bookkeeper-server-4.15.0-SNAPSHOT/conf/bk_server.conf
2022-04-01T18:18:16,121 - INFO  - [main:LocalBookKeeper@90] - Running 1 bookie(s) on zk ensemble = '127.0.0.1:2181'.
2022-04-01T18:18:16,123 - INFO  - [main:LocalBookKeeper@120] - Starting ZK server
2022-04-01T18:18:16,128 - INFO  - [main:ZookeeperBanner@42] - 
2022-04-01T18:18:16,128 - INFO  - [main:ZookeeperBanner@42] -   ______                  _                                          
2022-04-01T18:18:16,129 - INFO  - [main:ZookeeperBanner@42] -  |___  /                 | |                                         
2022-04-01T18:18:16,129 - INFO  - [main:ZookeeperBanner@42] -     / /    ___     ___   | | __   ___    ___   _ __     ___   _ __   
2022-04-01T18:18:16,129 - INFO  - [main:ZookeeperBanner@42] -    / /    / _ \   / _ \  | |/ /  / _ \  / _ \ | '_ \   / _ \ | '__|
2022-04-01T18:18:16,129 - INFO  - [main:ZookeeperBanner@42] -   / /__  | (_) | | (_) | |   <  |  __/ |  __/ | |_) | |  __/ | |    
2022-04-01T18:18:16,129 - INFO  - [main:ZookeeperBanner@42] -  /_____|  \___/   \___/  |_|\_\  \___|  \___| | .__/   \___| |_|
2022-04-01T18:18:16,129 - INFO  - [main:ZookeeperBanner@42] -                                               | |                     
2022-04-01T18:18:16,129 - INFO  - [main:ZookeeperBanner@42] -                                               |_|                     
2022-04-01T18:18:16,130 - INFO  - [main:ZookeeperBanner@42] - 
2022-04-01T18:18:16,131 - INFO  - [main:Environment@98] - Server environment:zookeeper.version=3.6.2--803c7f1a12f85978cb049af5e4ef23bd8b688715, built on 09/04/2020 12:44 GMT
2022-04-01T18:18:16,131 - INFO  - [main:Environment@98] - Server environment:host.name=ignatius
2022-04-01T18:18:16,131 - INFO  - [main:Environment@98] - Server environment:java.version=11.0.14.1
2022-04-01T18:18:16,131 - INFO  - [main:Environment@98] - Server environment:java.vendor=Ubuntu
2022-04-01T18:18:16,131 - INFO  - [main:Environment@98] - Server environment:java.home=/usr/lib/jvm/java-11-openjdk-amd64

However, when doing the same exact experiment with last branch-4.15 commit, I can confirm that logging is not working:

$ bin/bookkeeper localbookie 1
2022-04-01T15:38:45,252 - WARN  - [main:ServerCnxnFactory@309] - maxCnxns is not configured, using default value 0.

@hangc0276
Copy link
Contributor

hangc0276 commented Apr 2, 2022

Thanks for you reply @RaulGracia . I test #2837 by update the log4j version from 2.14.1 to 2.17.1, It only print few logs out. But use log4j 2.14.1 works well.

The detail log paste here: #2816 (comment)

@RaulGracia
Copy link
Contributor

RaulGracia commented Apr 6, 2022

@hangc0276 thanks, you are right, and I have checked that the problem with logging started with this PR switching to log4j 2.17.1.
Trying to spot in the release notes of that version what could be causing this change in behavior: https://logging.apache.org/log4j/2.x/changes-report.html#a2.17.1

@RaulGracia
Copy link
Contributor

@eolivelli @hangc0276 please, check locally #3188 to validate that it fixes the logging problem in your settings. If it works for you, we would need to merge it, cherry-pick it to branch-4.15 and create a new RC candidate, right?

@dlg99 dlg99 closed this as completed Apr 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants