亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 3620 | 回復(fù): 7
打印 上一主題 下一主題

[Web] 請教:nginx日志記錄 [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2010-03-19 14:33 |只看該作者 |倒序瀏覽
我的日志格式是這樣的:
    log_format  main  '$remote_addr - $remote_user [$time_local]  '
                      '"$request_method $scheme://$host$request_uri $server_protocol" $status $body_bytes_sent '
                      '"$http_referer" "$http_user_agent"';

但是我發(fā)現(xiàn)日志中記錄的很多內(nèi)網(wǎng)訪問的記錄,就是$remote_addr都是192.168.xx.xx這樣的記錄,因為日志比較大,所以我不想要這部分的記錄。
也就是說nginx能否做到根據(jù)來源IP來判斷是否記錄日志呢?像squid的那樣?
謝謝!

論壇徽章:
0
2 [報告]
發(fā)表于 2010-03-19 14:53 |只看該作者
i don't know how to solve your problem with log files of nginx.as a system administraor.we should save the entire access log and error day within at least one week.

to prevent your log file from being unlimitedly increased.you have to rotate your log file.
these log files are divided by one day or several hours.to do so.you search the Internet to get help.

論壇徽章:
0
3 [報告]
發(fā)表于 2010-03-19 14:57 |只看該作者
感謝todayhero 的回復(fù),但是您說的辦法不可行。
畢竟都有自己的需求在,這里的日志是需要每天上傳并分析的,并且還要備份。
所以不太希望里面出現(xiàn)大量的無用數(shù)據(jù),最笨的辦法是在上傳前先把不要的數(shù)據(jù)grep -v掉。
但是我還是希望能通過nginx自己的一些機制來處理。
畢竟grep很不效率。
謝謝!

論壇徽章:
0
4 [報告]
發(fā)表于 2010-03-19 15:30 |只看該作者
I  see.

your requirement is little particular.ordinary OS can not help you.you thoroughly depend on yourself.i don't find out any helps from the manual of nginx documents.if you have the time.you carefully read its manual.

Can you tell me whether the clients of LAN access the specific directory.if the clients of LAN acces the specific content you can separately log their access log.such as

location /foobar {
access_log /var/log/foobar.log;
}

this example indicted the access log of 'footbar' directory is written to foobar.log

if this feature is not built-in you only use third-party tools or program developed by yourself.

good luck.

論壇徽章:
0
5 [報告]
發(fā)表于 2010-03-19 15:33 |只看該作者
樓上的英文好像很好喲。嘿嘿向你學(xué)習(xí)

論壇徽章:
0
6 [報告]
發(fā)表于 2010-03-19 15:49 |只看該作者
回復(fù) 5# scyzxp


    thanks for your praise.i am bored to be dead every day.have no alternate but learning english.

論壇徽章:
0
7 [報告]
發(fā)表于 2010-03-19 15:58 |只看該作者
location /foobar {
access_log /var/log/foobar.log;
}

perfect 。!
OK!實現(xiàn)分離了,不需要的雖然沒有禁止,但是他記錄到了另外一個access.log中,這就是我的需要的!
非常感謝todayhero 。
感謝!

論壇徽章:
0
8 [報告]
發(fā)表于 2010-03-19 21:45 |只看該作者
回復(fù) 6# todayhero


    我想你應(yīng)該去翻譯一些技術(shù)手冊這樣學(xué)習(xí)更快。
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP