GitHub user jacobtolar opened a pull request:
https://github.com/apache/storm/pull/2806
[STORM-3198] Topology submitters should be able to supply log4j2 conf
This adds a new config setting, `topology.logging.config`, that allows a
topology submitter to specify an additional log4j2 config to be used via
composite configuration.
When the worker starts the `-Dlog4j.configurationFile` option is modified
to include the additional file if requested.
To test, I submitted a topology (FastWordCountTopology):
```
bin/storm jar -c
topology.logging.config=classpath:resources/topology_log4j2.xml
../../../../../examples/storm-starter/target/storm-starter-*.jar
org.apache.storm.starter.FastWordCountTopology fwc
```
topology_log4j2.xml:
```
<configuration monitorInterval="60" shutdownHook="disable">
<loggers>
<root>
<RegexFilter regex=".*Preparing.*" onMatch="DENY"
onMismatch="ACCEPT" />
</root>
<Logger name="org.apache.storm.metric.LoggingMetricsConsumer">
<RegexFilter regex=".*Preparing.*" onMatch="DENY"
onMismatch="ACCEPT" />
</Logger>
<Logger name="STDERR">
<RegexFilter regex=".*Preparing.*" onMatch="DENY"
onMismatch="ACCEPT" />
</Logger>
<Logger name="STDOUT">
<RegexFilter regex=".*Preparing.*" onMatch="DENY"
onMismatch="ACCEPT" />
</Logger>
</loggers>
</configuration>
```
With this child configuration added, the messages about [preparing
bolts](https://github.com/apache/storm/blob/26d2f955251c0fa56520f6fe08cb35ef5171f321/storm-client/src/jvm/org/apache/storm/executor/bolt/BoltExecutor.java#L109)
no longer appear in the worker log.
I also tested changing simply changing the log level in the child log4j2
config and that also works as expected.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/jacobtolar/storm STORM-3198
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/storm/pull/2806.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #2806
----
commit 28ad8dc77b409339768484839ab6979f42ce07ff
Author: Jacob Tolar <jtolar@...>
Date: 2018-08-15T19:53:42Z
[STORM-3198] Topology submitters should be able to supply log4j2
configurations
----
---