mirror of
https://gitee.com/dromara/Jpom.git
synced 2024-12-02 11:58:01 +08:00
启动检查tail 是否配置
This commit is contained in:
parent
c05b287a9e
commit
aa2660dc54
@ -123,6 +123,10 @@ mvn package
|
||||
|
||||
[用户角色说明>>](/doc/safeMode.md#用户权限说明)
|
||||
|
||||
### windows 开启实时查看控制台日志
|
||||
|
||||
[飞机>>](/doc/windows-tail.md)
|
||||
|
||||
### 阿里云Oss配置
|
||||
|
||||
[查看文档](/doc/CodePipeline-Oss.md)
|
||||
|
15
doc/windows-tail.md
Normal file
15
doc/windows-tail.md
Normal file
@ -0,0 +1,15 @@
|
||||
# windows 开启控制台实时查看日志
|
||||
|
||||
Jpom中实时查看控制台日志使用 tail -f 实现,windows 不支持tail 命令。所以需要使用插件
|
||||
|
||||
安装方式复制script [tail.exe](/script/tail.exe) 到系统目录中
|
||||
|
||||
如:系统在C:盘
|
||||
|
||||
C:\Windows\System32
|
||||
|
||||
则复制到:
|
||||
|
||||
C:\Windows\System32\tail.exe
|
||||
|
||||
### ok
|
@ -3,6 +3,9 @@ package cn.keepbx.jpom.system.init;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.io.resource.ResourceUtil;
|
||||
import cn.hutool.core.util.CharsetUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.system.JavaRuntimeInfo;
|
||||
import cn.hutool.system.SystemUtil;
|
||||
import cn.jiangzeyin.common.DefaultSystemLog;
|
||||
import cn.jiangzeyin.common.JsonMessage;
|
||||
import cn.jiangzeyin.common.PreLoadClass;
|
||||
@ -42,6 +45,7 @@ public class CheckRunCommand {
|
||||
*/
|
||||
@PreLoadMethod
|
||||
private static void checkSh() throws Exception {
|
||||
tipTail();
|
||||
try {
|
||||
ConfigBean.getInstance().getRamCommandPath();
|
||||
} catch (ConfigException e) {
|
||||
@ -56,6 +60,36 @@ public class CheckRunCommand {
|
||||
}
|
||||
}
|
||||
|
||||
private static void tipTail() {
|
||||
if (!AbstractCommander.OS_INFO.isWindows()) {
|
||||
return;
|
||||
}
|
||||
JavaRuntimeInfo javaRuntimeInfo = SystemUtil.getJavaRuntimeInfo();
|
||||
String path = javaRuntimeInfo.getLibraryPath();
|
||||
String[] paths = StrUtil.splitToArray(path, ';');
|
||||
for (String itemPath : paths) {
|
||||
String item = FileUtil.normalize(itemPath);
|
||||
int index = item.indexOf(StrUtil.COLON);
|
||||
if (index < 0) {
|
||||
continue;
|
||||
}
|
||||
item = item.substring(index + 1);
|
||||
if (item.startsWith(StrUtil.SLASH)) {
|
||||
item = item.substring(1);
|
||||
}
|
||||
if (item.endsWith(StrUtil.SLASH)) {
|
||||
item = item.substring(0, item.length() - 1);
|
||||
}
|
||||
if (StrUtil.equalsIgnoreCase("WINDOWS/system32", item)) {
|
||||
File file = new File(itemPath, "tail.exe");
|
||||
if (!file.exists()) {
|
||||
DefaultSystemLog.LOG().info("还未配置tail:详情查看>> https://gitee.com/keepbx/jpom/blob/master/doc/windows-tail.md");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查运行数据
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user