如何获取log4j2中使用的所有记录器?在log4j中,我可以像这里描述的那样使用getCurrentLoggers:Numberofloggersused 最佳答案 获取log4j2中使用的所有记录器:LoggerContextlogContext=(LoggerContext)LogManager.getContext(false);Mapmap=logContext.getConfiguration().getLoggers();注意:使用org.apache.logging.log4j.core.LoggerContext不