Valve> prefix :规定日志文件的前缀,即日志文件的名字
suffix :规定日志文件的后缀,即日志文件的文件格式
pattern(模式),pattern的两个值区别如下:
common 的值: %h %l %u %t %r %s %b
combined 的值: %h %l %u %t %r %s %b %{Referer}i %{User-Agent}i
注:%a - Remote IP address
%A - Local IP address
%b - Bytes sent, excluding HTTP headers, or '-' if zero
%B - Bytes sent, excluding HTTP headers
%h - Remote host name (or IP address if resolveHosts is false)
%H - Request protocol
%l - Remote logical username from> %m - Request method (GET, POST, etc.)
%p - Local port on which this request was received
%q - Query string (prepended with a '?' if it exists)
%r - First line of the request (method and request URI)
%s - HTTP status code of the response
%S - User session> %t - Date and time, in Common Log Format
%u - Remote user that was authenticated (if any), else '-'
%U - Requested URL path
%v - Local server name
%D - Time taken to process the request, in millis
%T - Time taken to process the request, in seconds
%I - current request thread name (can compare later with stacktraces)
rotatable:决定日志是否轮巡
true :轮巡,并把时间加入日志名中
false:不轮巡。日志记录一直保存在同一个文件中
resolveHosts:决定是否把远程的主机ip 通过DNS 查找返回主机名
true : 返回主机名,
false:不去查找
注:查不到以“-”代替
fileDateFormat:决定轮巡的日志名字追加的时间格式,以及通过时间格式确定轮巡的周期即日志写
到新日志文件的周期。yyyy-MM-dd.HH 把值设定前文,是每个小时产生新的日志文件。不写此项,
系统默认是每天轮巡。
其他参数详见:http://tomcat.apache.org/tomcat-6.0-doc/config/valve.html
修改完要重启tomcat服务
3.在fluentd 的收集端
vim /etc/td-agent/td-agent.conf