简体   繁体   English

使用mmc rest API将日志文件从后端发送到UI-仅发送文件更改的逻辑

[英]send log file from backend to UI using mmc rest API- logic for sending only the changes in file

I am trying to use rest APIs provided by mule management console to retrieve server log files. 我正在尝试使用m子管理控制台提供的rest API来检索服务器日志文件。 http://www.mulesoft.org/documentation/display/current/Servers http://www.mulesoft.org/documentation/display/current/Servers

My intention is to use this List File API 我的意图是使用此列表文件API

http://localhost:8080/mmc-console-3.4.0/api/servers/{serverId}/files/{relativePathToFile}[?metadata=true] 

provided and display the logs in UI. 提供并在UI中显示日志。

1) What should be the return type of the method I make as the above API call is returning a file? 1)当上述API调用返回文件时,我应该使用的方法的返回类型应该是什么? Would it be 'File' ? 会是“文件”吗?

2) Since the size of the mule_ee.log file could be large, I want to send the entire file for first call and from next call I just want to send the few lines appended at the last so that UI will do the appending and show it in console. 2)由于mule_ee.log文件的大小可能很大,因此我想发送整个文件以进行第一次调用,而从下一次调用开始,我只想发送最后附加的几行,以便UI进行附加并显示在控制台中。 Is this feasible ? 这可行吗? Is there a better approach to do this ? 有更好的方法吗?

As per documentation you will get the file itself. 根据文档,您将获得文件本身。 However there is no incremental mechanism. 但是,没有增量机制。

For this matters you should probably use rsync or an advanced log distribution system. 为此,您可能应该使用rsync或高级日志分发系统。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM