【发布时间】:2020-11-11 12:46:49
【问题描述】:
我正在使用通过 docker-compose 在本地部署的 SCDF 2.5.1,我的软件通过 java DSL 向 SCDF 服务器发送命令。
假设我创建了一个流
file > :queue
:queue > ftp
file 和 ftp 是 docker 部署的应用程序。
我的问题是,如何获取 file 和 ftp 的日志?
到目前为止,我想出的最接近的东西是
Map<String, String> attributes = scdf.runtimeOperations().streamStatus(streamName).getContent()
.stream().flatMap(stream -> stream.getApplications().getContent().stream()
.filter(app -> app.getName().equals(appName))
.flatMap(appStatus -> appStatus.getInstances().getContent().stream()
.map(AppInstanceStatusResource::getAttributes)))
.findFirst().orElse(Collections.emptyMap());
String logLocation = attributes.get("stdout")
然后挂载logLocation 并将其作为文件读取。
有没有更优雅的解决方案?
【问题讨论】: