pulsar icon indicating copy to clipboard operation
pulsar copied to clipboard

change pulsar.log.level in log4j2.yaml not work?

Open ethqunzhong opened this issue 3 years ago • 10 comments

change pulsar.log.level in log4j2.yaml not work?

Describe the bug i modify the value of pulsar.log.root.level and pulsar.log.level from info to warn in conf/log4j2.yaml without restart broker service. as follow: image

as this issue discribe Add ability to log at a dynamic level, log4j2.x support reload conf with process restart.so as expected behavior, after monitorInterval later, broker service log's log level should be not lower than warn.but in fact, latest output log still is info. image

That's not what we expected.

Version

  • pulsar version: 2.7.2
  • log4j2 version: 2.17.1

Does anyone have the same problem?

ethqunzhong avatar Feb 15 '22 11:02 ethqunzhong

Did you try with 2.9 or current master?

Usually I use a ENV property Also if you are using Pulsar standalone the only way is to use the ENV property

eolivelli avatar Feb 15 '22 11:02 eolivelli

Did you try with 2.9 or current master?

Usually I use a ENV property Also if you are using Pulsar standalone the only way is to use the ENV property

i use 2.7.2 version in product environment and modify log4j2.yaml manual without restart broker. ENV property use default value when deploy broker service. i will try use Pulsar standalone for a test later. thx suggest.

ethqunzhong avatar Feb 15 '22 12:02 ethqunzhong

Did you try with 2.9 or current master?

Usually I use a ENV property Also if you are using Pulsar standalone the only way is to use the ENV property

you mean add ENV property such as PULSAR_LOG_LEVEL in pulsar_env.sh , then run command /bin/pulsar-daemon start broker ?

ethqunzhong avatar Feb 16 '22 03:02 ethqunzhong

Did you try with 2.9 or current master? Usually I use a ENV property Also if you are using Pulsar standalone the only way is to use the ENV property

you mean add ENV property such as PULSAR_LOG_LEVEL in pulsar_env.sh , then run command /bin/pulsar-daemon start broker ?

i have a test, result as follow: as log4j2.yaml using way, image pulsar.log.level go into effect only set by ENV property PULSAR_LOG_LEVEL which set in pulsar_env.sh while service starting. while service running, change pulsar.log.level in log4j2.yaml is not work, pulsar.log.level is unmodifiable now.

ethqunzhong avatar Feb 16 '22 12:02 ethqunzhong

I think we should fix the log4j2.yaml, it has confused many users.

codelipenghui avatar Mar 15 '22 10:03 codelipenghui

@ethqunzhong @codelipenghui I'll try fix it.

Nicklee007 avatar Mar 15 '22 14:03 Nicklee007

@ethqunzhong @codelipenghui I'll try fix it.

thx a lot. can you help me review this pr https://github.com/apache/pulsar/pull/14200

ethqunzhong avatar Mar 20 '22 04:03 ethqunzhong

The issue had no activity for 30 days, mark with Stale label.

github-actions[bot] avatar Apr 20 '22 02:04 github-actions[bot]

The issue had no activity for 30 days, mark with Stale label.

github-actions[bot] avatar May 28 '22 02:05 github-actions[bot]

I have the same issue, and made a new PR to fix this: https://github.com/apache/pulsar/pull/22017

Please let us know your thoughts.

nodece avatar Feb 05 '24 16:02 nodece