2009年12月20日 星期日

[Linux] Apahce 整合到 syslog-ng

SLES 10

/etc/apache2/httpd.conf
--------------------------
|       ErrorLog  syslog:user
|       LogLevel  warn

上面那個LogLevel改不改無所謂  到最後會被覆蓋掉

/etc/sysconfig/apache2
---------------------------
|      APACHE_ACCESS_LOG="syslog:user  combined"
|      APACHE_LOGLEVEL="[自選]"

以上大綱  剩下看文件
syslog-ng設定檔的部分就跟老師上課的一樣



不過最後訊息不能全部整合,訊息如下
Dec 20 21:40:47 Linux gconfd (root-13560): Resolved address "xml:readwrite:/root/.gconf" to a writable configuration source at position 0


Dec 20 21:40:51 Linux kernel: ISO 9660 Extensions: Microsoft Joliet Level 3

Dec 20 21:40:51 Linux kernel: ISO 9660 Extensions: RRIP_1991A

Dec 20 21:40:51 Linux zmd: NetworkManagerModule (WARN): Failed to connect to NetworkManager

Dec 20 21:40:58 Linux zmd: Daemon (WARN): Not starting remote web server

Dec 20 21:41:50 Linux httpd2-prefork[12891]: [error] [client 192.168.150.1] File does not exist: /srv/www/htdocs/index


但是apache原始的access_log,如下
192.168.150.1 - - [20/Dec/2009:21:17:32 +0800] "GET / HTTP/1.1" 200 553 "-" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Trident/4.0; .NET CLR 1.1.4322)"


192.168.150.1 - - [20/Dec/2009:21:17:32 +0800] "GET /icons/folder.gif HTTP/1.1" 304 - "http://192.168.150.22/" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Trident/4.0; .NET CLR 1.1.4322)"

192.168.150.1 - - [20/Dec/2009:21:17:32 +0800] "GET /icons/blank.gif HTTP/1.1" 304 - "http://192.168.150.22/" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Trident/4.0; .NET CLR 1.1.4322)"

192.168.150.1 - - [20/Dec/2009:21:18:03 +0800] "GET /index.html HTTP/1.1" 404 1046 "-" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Trident/4.0; .NET CLR 1.1.4322)"

 
也就是說不能整合進來資訊太多了,整能簡簡單單的看到user連結錯誤的網頁會有個error紀
錄,但是apache內建的資訊卻是相當龐大的,有連線回應和連線錯誤都有紀錄,再來還有很
多很多,有興趣的請看apache的log文件,有格式教學。

http://httpd.apache.org/docs/2.2/mod/mod_log_config.html
 

沒有留言:

張貼留言