Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我不需要“容器 ID”或“应用尝试 ID”。
在我看到的文档${samza.log.dir}中,我们可以放置log4j 配置,并且此路径包含应用程序 ID。就像是/foo/log/../application_id_123
${samza.log.dir}
/foo/log/../application_id_123
我找到了解决方案,如果您知道更好的解决方案,您可以回复。
final String samzaLogDir = System.getProperty("samza.log.dir"); final String[] samzaLogDirSplit = samzaLogDir.split("/"); final String applicationId = samzaLogDirSplit[samzaLogDirSplit.length - 2];