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. [转载]C#设置开机启动

    原理就是在注册表启动项里添加一项.路径:SOFTWARE\Microsoft\Windows\CurrentVersion\Run或者直接:运行->regedit找到这个路径添加一项. usin ...

  2. PAT-乙级-1022. D进制的A+B (20)

    1022. D进制的A+B (20) 时间限制 100 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 CHEN, Yue 输入两个非负10进制整数A和 ...

  3. ZOJ Problem Set - 1002(DFS)

    http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1002 题意:给出一个n,有n*n大小的城市,(.)表示空地,从碉堡(O)射 ...

  4. YUV格式详解

    What is YUV YUV,是一种颜色编码方法. YUV是编译true-color颜色空间(color space)的种类,Y'UV, YUV, YCbCr,YPbPr等专有名词都可以称为YUV, ...

  5. JNDI:对java:comp/env的研究

    这两天研究了一下 context.lookup("java:comp/env/XXX")和直接context.lookup("XXX")的区别 网上关于这两个的 ...

  6. 使用eclipse远程调试Tomcat的方法

    tomcat是一种非常常见的java web应用服务器,有时候服务器可能并不是部署在本地,而是部署在远程其他的机器上,我们用eclispe该如何进行debug调试呢? 1. 在eclispe中新建we ...

  7. 李洪强iOS开发之宏定义方法来初始化一个单例对象

    单例的使用: .m 为了方便实用,只要将以下代码定义在header文件或者.pch文件即可: // .h #define singleton_interface(class) + (instancet ...

  8. 李洪强漫谈iOS开发[C语言-014]-变量

    01 变量的概念 02 - 变量的语法 03 变量的使用

  9. C++对象的自销毁

    记得在学校里的时候,曾经这样写过: void MyClass::KillMe() { delete this; } 老师看到这句话的时候,眼珠子都快瞪出来了.但是运行正确啊,没什么问题. 现在想起来, ...

  10. swap chain- IDirect3DSwapChain9

    交换链,对应的接口是IDirect3DSwapChain9,是整个Directx 3D中最核心的接口.D3d程序至少包含一个swap chain,在调用CreateDevice时自动创建, 其中的D3 ...