background:

项目中的一个小工具,是一个Cron Job ,每天去搜集下服务器Hadoop Job的运行状态,并生成一份报告发送给整个Team,生产报告的同时把相关的日志文件保存到固定的一台机子上,方便以后查看和分析,因为生产环境上的Log只保存7天。

问题:

日志是保存上固定的目录下面,而且是在Linux系统上面,是我们Local的一台机子。我们Email Report 无法通过 file schema 的方式访问到该文件,所以我就想通过Tomcat 搭建一个Web服务器来访问到该文件,这个可以跨环境,而且国外的同事也可以

看到日志信息。

解决:

tomcat version :7.0.55

update the server.xml

<Host appBase="webapps"
autoDeploy="false" name="localhost" unpackWARs="true"
xmlNamespaceAware="false" xmlValidation="false">
<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
<!--
<Valve className="org.apache.catalina.authenticator.SingleSignOn" />
-->

<!-- Access log processes all example.
Documentation at: /docs/config/valve.html
Note: The pattern used is equivalent to using pattern="common" -->
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log." suffix=".txt"
pattern="%h %l %u %t &quot;%r&quot; %s %b" />

<Context docBase="/home/hadoop/UC4Report" path="/project/report" />
</Host>

-----------------------------------------------------------------------------------------------

/home/hadoop/UC4Report is the file folder

/project/report is the access path

we can access the file MD_RUN_INFLUENCER_PROD_586404867:

http://10.**.**.52:8080/project/report/2014-08-04/MD_RUN_INFLUENCER_PROD_586404867

use tomcat to access the file cross the environment的更多相关文章

  1. springboot中配置tomcat的access log

    在tomcat的access中打印出请求的情况可以帮助我们分析问题,通常比较关注的有访问IP.线程号.访问url.返回状态码.访问时间.持续时间. 在Spring boot中使用了内嵌的tomcat, ...

  2. Tomcat访问(access)日志配置

    在tomcat的access中打印出请求的情况可以帮助我们分析问题,通常比较关注的有访问IP.线程号.访问url.返回状态码.访问时间.持续时间. 最近在跟一个图片请求超时的问题,需要在项目的acce ...

  3. FileStream:The process cannot access the file because it is being used by another process

    先看下面一段代码(先以共享的方式打开文件读写,然后以只读的方式打开相同文件): FileStream fs  = new FileStream(filePath, FileMode.Open, Fil ...

  4. C# The process cannot access the file because it is being used by another process

    C# The process cannot access the file because it is being used by another process   The process cann ...

  5. Microsoft Office Excel cannot access the file, There are several possible reasons

    今天在做EXCEL打印读取模板时报错了,错误信息如下: Microsoft Excel cannot access the file 'D:\xx.xlsx'. There are several p ...

  6. 解决VS2010连接VSS时,Access to file"\\***\rights.dat" denied

    1.通过VS2010打开项目链接VSS后,提示 Access to file"\\***\rights.dat" denied. 该提示是指没有网络访问的权限,用户要在共享文件夹有 ...

  7. HDFS relaxes a few POSIX requirements to enable streaming access to file system data

    https://hadoop.apache.org/docs/r2.7.2/hadoop-project-dist/hadoop-hdfs/HdfsDesign.html Introduction [ ...

  8. 无法完成安装:'Cannot access storage file '/

    今天自己编译了spice-protocol spice-gtk spice qemu,然后想用virsh去创建一个虚机: # virsh define demo.xml     定义域 demo(从 ...

  9. excel cannot access the file there are several possible reasons

    original link Microsoft Office Excel cannot access the file ‘c:\file.xlsx’. There are several possib ...

随机推荐

  1. spoj 338

    题意: 无向图  每条边有长度和费用两个属性  求从点1到点n 在花费不超过 k 的情况下的最短路径 BFS  使用优先队列 长度短的优先出列      题解上的方法没看懂  不知道怎么用链表维护 . ...

  2. [笨木头FireFly 02]入门篇2_客户端发送请求,服务器处理请求

    原地址:http://www.9miao.com/question-15-53940.html 好,经过上一篇不权威的讲解,大家已经能轻易地让客户端和服务端连接起来了. 但是,仅仅是连接了,可它们俩不 ...

  3. C++ 嵌套类使用(二)

    C++嵌套类 1.   嵌套类的名字只在外围类可见. 2.   类的私有成员只有类的成员和友元可以访问,因此外围类不可以访问嵌套类的私有成员.嵌套类可以访问外围类的成员(通过对象.指针或者引用). 3 ...

  4. [itint5]树中最大路径和

    http://www.itint5.com/oj/#13 要注意,一是空路径也可以,所以最小是0.然后要时刻注意路径顶多有两条子路径+根节点组成,所以更新全局最值时和返回上一级的值要注意分清. #in ...

  5. MyBatis之传入参数parameterType

    在MyBatis的select.insert.update.delete这些元素中都提到了parameterType这个属性.MyBatis现在可以使用的parameterType有基本数据类型和Ja ...

  6. 【转】linux C++ 获取文件信息 stat函数详解

    stat函数讲解 表头文件:    #include <sys/stat.h>             #include <unistd.h>定义函数:    int stat ...

  7. 单独下载的Qt library则一般不带SSL(包括QT FAQ)

    http://www.cnblogs.com/E7868A/archive/2012/11/15/2771501.html http://www.oldcai.com/archives/208 htt ...

  8. Kali2.0 Sqlmap清除历史扫描日志

    使用Sqlmap扫描SQL注入漏洞时,首次扫描会在SQL的/root/.sqlmap/output/目录下留下 以IP地址为名称的文件夹,如下所示: 而如果该安全漏洞经过修复后,再次使用SQLMAP扫 ...

  9. R语言学习笔记:怎么从txt中读入数据

    1   从该链接中下载测试数据,http://pan.baidu.com/share/link?shareid=3322971616&uk=3862050759   2   把测试文件Anal ...

  10. 23.allegro中钻孔[原创]

    1.钻孔: NC Parameters,NC Drill, Dill Legend, NC Route ----------------------- ------ ----- ------- --- ...