You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "TSFenwick (via GitHub)" <gi...@apache.org> on 2023/04/17 22:12:09 UTC
[GitHub] [druid] TSFenwick commented on a diff in pull request #14094: Allow for Log4J to be configured for peons but still ensure console logging is enforced
TSFenwick commented on code in PR #14094:
URL: https://github.com/apache/druid/pull/14094#discussion_r1169312057
##########
indexing-service/src/main/java/org/apache/druid/indexing/common/tasklogs/ConsoleLoggingEnforcementConfigurationFactory.java:
##########
@@ -117,16 +123,20 @@ private Appender findConsoleAppender()
}
/**
- * remove all appenders from a logger and append a console appender to it
+ * Ensure there is a console logger defined. Without a console logger peon logs wont be able to be stored in deep storage
*/
private void applyConsoleAppender(LoggerConfig logger, Appender consoleAppender)
{
- if (logger.getAppenderRefs().size() == 1
- && logger.getAppenderRefs().get(0).getRef().equals(consoleAppender.getName())) {
- // this logger has only one appender and its the console appender
- return;
+ // Alter log level for this class to be warning. This needs to happen because the logger is using the default
+ // config, which is level error and appends to console, since the logger is being configured here.
+ Configurator.setLevel(LogManager.getLogger(ConsoleLoggingEnforcementConfigurationFactory.class).getName(), Level.WARN);
Review Comment:
done. needed to alter the druid logger class to make getName available. testing out the change to make sure it still works as expected
--
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: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org