标签:style http color os io 文件 2014 ar
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 "%r" %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,布布扣,bubuko.com
use tomcat to access the file cross the environment
标签:style http color os io 文件 2014 ar
原文地址:http://www.cnblogs.com/hugeshi/p/3894544.html