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. javascript div z-index, input tabindex属性说明

    <html> <body> <form> 用户名: <input type="text" tabindex="1" / ...

  2. 2013 Multi-University Training Contest 4 Who's Aunt Zhang

    看题就知道要用polya,但是当时没做出来,还是不是很熟悉polya!!! 总共有24种置换: 1. 不做任何旋转 K ^ (54 + 12 + 8) 2. 绕相对面中心的轴转 1) 90度 K ^ ...

  3. MyBatis之传入参数parameterType

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

  4. 新的HTTP框架:Daraja Framework

    https://www.habarisoft.com/daraja_framework.html

  5. Silverlight之Styles和Behaviors

    本文简介 1.定义简单的Style 2.应用Style到元素 3.动态加载Style资源文件 4.Style的继承 5.组织内编写Style(在元素内) 6.自动应用Style到指定类型元素 7.St ...

  6. Struts中的 saveToken的方法

    Struts中的 saveToken的方法     saveToken防止2次提交的问题 struts有自带的Token(令牌)的机制来解决重复提交(包括后退,刷新等).举例: 假设:假设有一个新增用 ...

  7. Vim常用命令手册

    这两年工作基本都是用vim,用习惯发现到哪都离不开这玩意. 退出编辑器 :w 将缓冲区写入文件,即保存修改:wq 保存修改并退出:x 保存修改并退出:q 退出,如果对缓冲区进行过修改,则会提示:q! ...

  8. NLog 传递参数

    用NLog记文件日志,一般都用{$basedir}变量,把日志记在运行的目录或者它的子目录下,遇到要写在其他目录的下,看了下Nlog找到用环境变量传参数. .net 里写 Environment.Se ...

  9. poj1180

    斜率优化dp 据说这题朴素的O(n2)dp也可以A 没试过 朴素的dp不难想:f[i]=min(f[j]+sumtime[i]*sumcost[j+1,i]+c*sumcost[j+1,n]) 稍微解 ...

  10. poj2月下旬题解

    poj2388 水题 poj1273 最大流初步 poj2456 简单的二分答案 poj2309 论lowbit的重要性 poj1734 floyd求最小环 poj1001 细节题 poj2184 0 ...