# tailf **Repository Path**: Annlody/tailf ## Basic Information - **Project Name**: tailf - **Description**: 分布式日志-查看 - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 29 - **Created**: 2021-04-04 - **Last Updated**: 2021-04-04 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## tailf 一个类似linux tail的web版本日志查看工具 提交在github(https://github.com/aqu415/tailf) 再同步到码云(https://gitee.com/aqu415/tailf) ### 背景 > 前一段时间由于项目原因,需要经常上服务器看日志;由于没有公共的页面查看与下载,就需要频繁的登录服务器,然后执行一堆命令,最后才能看到日志; > 这个过程太痛苦,网上搜了一圈没有合适的工具,于是自己写了一个简单的日志实时查看的工具,取名叫 Web-tailf ### 原理 > Websocket + FileAlterationListenerAdaptor ### gitee地址 https://gitee.com/aqu415/tailf ### 本地调试 本地调试如果需要监听多个目录可以通过以下配置,多个目录间以 ; 分隔 ![在这里插入图片描述](https://img-blog.csdnimg.cn/20210320100926895.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0FxdTQxNQ==,size_16,color_FFFFFF,t_70) ### 打包 依赖spring-boot打包插件,打成可执行jar包 ![在这里插入图片描述](https://img-blog.csdnimg.cn/20210312111021171.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0FxdTQxNQ==,size_16,color_FFFFFF,t_70) ### 服务器上jar包启动 支持监听多个目录 ``` linux后台运行: nohup java -jar tailf-web-1.0-xxx.jar "/usr/logs/tomcat1" "/usr/logs/tomcat2" & windows窗口启动 java -jar tailf-web-1.0-xxx.jar "/usr/logs/tomcat1" "/usr/logs/tomcat2" ``` ### 效果 #### Extjs风格 + 访问地址:http://localhost:10086/ ![在这里插入图片描述](https://img-blog.csdnimg.cn/20210320173555590.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0FxdTQxNQ==,size_16,color_FFFFFF,t_70) #### 普通风格 + 访问地址:http://localhost:10086/s ![在这里插入图片描述](https://img-blog.csdnimg.cn/20210320173807869.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0FxdTQxNQ==,size_16,color_FFFFFF,t_70)