FrankChen021 opened a new pull request #12067:
URL: https://github.com/apache/druid/pull/12067
### Description
Fixes the problem mentioned in #10147 by @clintropolis that peon process's
log is output to middle manager's log file.
Currently all Druid processes share the same log4j2 configuration file
located in `_common` directory. Since peon processes are spawned by middle
manager process, they derivate the environment variables from the middle
manager. These variables include those in the `log4j2.xml` controlling to which
file the logger writes the log.
But current task logging mechanism requires the peon processes to output the
log to console so that the middle manager can redirect the console output to a
file and upload this file to task log storage.
So, this PR imposes this requirement to peon processes, **whatever the
configuration is in the shared log4j2.xml, peon processes always write the log
to console**.
<hr>
##### Key changed/added classes in this PR
* added `ConsoleLoggingEnforcementConfigurationFactory.java`, to enfore
`ConsoleAppender` is used
* updated `ForkingTaskRunner.java`, to pass a
`-Dlog4j2.configurationFactory` argument to peon
<hr>
This PR has:
- [X] been self-reviewed.
- [ ] using the [concurrency
checklist](https://github.com/apache/druid/blob/master/dev/code-review/concurrency.md)
(Remove this item if the PR doesn't have any relation to concurrency.)
- [ ] added documentation for new or modified features or behaviors.
- [] added Javadocs for most classes and all non-trivial methods. Linked
related entities via Javadoc links.
- [ ] added or updated version, license, or notice information in
[licenses.yaml](https://github.com/apache/druid/blob/master/dev/license.md)
- [X] added comments explaining the "why" and the intent of the code
wherever would not be obvious for an unfamiliar reader.
- [ ] added unit tests or modified existing tests to cover new code paths,
ensuring the threshold for [code
coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md)
is met.
- [ ] added integration tests.
- [X] been tested in a test Druid cluster.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]