【求助】有夠大的log檔

顯示結果從第 1 筆 到 4 筆,共計 4 筆
  1. #1
    皮皮您快回家
    註冊日期
    2001-11-25
    所在地區
    ADSL 8M/640K
    討論區文章
    336

    【求助】有夠大的log檔

    【求助】有夠大的log檔
    皮皮這幾飽受syn flood之苦...
    頻寬老是被佔據!

    想說查看個log檔看看!
    沒有想到httpd抵下的access_log檔
    居然440MB
    另一個access_log.2也有200多MB

    用SAMBA把檔案叫到WIN上看...
    使用筆記本打開到記憶體不足....有什麼辦法可以查看裡面的資訊呢?

    真是給它有夠恐怖...在LINUX內也是跑了半黇沒有反應說!
    LOG檔有辦法字定大小限制嗎?

    謝謝~



  2. #2
    進階會員 repsol 的大頭照
    註冊日期
    2001-06-17
    所在地區
    ADSL 2M/256
    討論區文章
    818
    把 LOG file 分割成幾個file , 然後再逐一看
    詳情可以 man split

    SPLIT(1) FreeBSD General Commands Manual SPLIT(1)

    NAME
    split - split a file into pieces

    SYNOPSIS
    split [-a suffix_length] [-b byte_count[k|m]] [-l line_count]
    [-p pattern] [file [name]]

    DESCRIPTION
    The split utility reads the given file and breaks it up into files of
    1000 lines each. If file is a single dash (`-') or absent, split reads
    from the standard input.

    The options are as follows:

    -a Use suffix_length letters to form the suffix of the file name.

    -b Create smaller files byte_count bytes in length. If ``k'' is
    appended to the number, the file is split into byte_count kilo?
    byte pieces. If ``m'' is appended to the number, the file is
    split into byte_count megabyte pieces.

    -l Create smaller files n lines in length.

    -p pattern
    The file is split whenever an input line matches pattern, which
    is interpreted as an extended regular expression. The matching
    line will be the first line of the next output file. This option
    is incompatible with the -b and -l options.

    If additional arguments are specified, the first is used as the name of
    the input file which is to be split. If a second additional argument is
    specified, it is used as a prefix for the names of the files into which
    the file is split. In this case, each file into which the file is split
    is named by the prefix followed by a lexically ordered suffix using
    suffix_length characters in the range ``a-z''. If -a is not specified,
    two letters are used as the suffix.

    If the name argument is not specified, the file is split into lexically
    ordered files named with prefixes in the range of ``x-z'' and with suf?
    fixes as above.

    SEE ALSO
    re_format(7)

    STANDARDS
    The split utility conforms to IEEE Std 1003.1-2001 (``POSIX.1'').

    HISTORY
    A split command appeared in Version 3 AT&T UNIX.

    BUGS
    For historical reasons, if you specify name, split can only create 676
    separate files. The default naming convention allows 2028 separate
    files. The -a option can be used to work around this limitation.

    The maximum line length for matching patterns is 65536.

    FreeBSD 4.7 April 16, 1994 FreeBSD 4.7


    ex :

    split -l 幾行 愈分解的 file


    限制 LOG 檔案大小的問題
    可以定時 rotate log , 就可以控制 log 的檔案大小
    可以一天 rotate 一次 , 或是每12個小時 rotate 一次
    都可以控制 log file 的大小
    下面的文章說明的很清楚 , 可以參考參考...



    http://httpd.apache.org/docs/logs.html#rotation

    On even a moderately busy server, the quantity of information stored in the log files is very large. The access log file typically grows 1 MB or more per 10,000 requests. It will consequently be necessary to periodically rotate the log files by moving or deleting the existing logs. This cannot be done while the server is running, because Apache will continue writing to the old log file as long as it holds the file open. Instead, the server must be restarted after the log files are moved or deleted so that it will open new log files.

    By using a graceful restart, the server can be instructed to open new log files without losing any existing or pending connections from clients. However, in order to accomplish this, the server must continue to write to the old log files while it finishes serving old requests. It is therefore necessary to wait for some time after the restart before doing any processing on the log files. A typical scenario that simply rotates the logs and compresses the old logs to save space is:

    mv access_log access_log.old
    mv error_log error_log.old
    apachectl graceful
    sleep 600
    gzip access_log.old error_log.old
    Another way to perform log rotation is using piped logs as discussed in the next section


    Good Luck !!!
    「遥か昔、正義に生きる悪魔の伝説があった。
    剣を取って戦い、悪魔の侵略を退けた魔剣士。
    その伝説も、やがて人々の記憶から消えて行った。

    だが2000年の時を経て、魔界はより強大になって甦る。
    圧倒的なパワーで押し寄せる魔界の軍勢。
    本格的な人間界侵攻が始まった…。

    再び訪れた人類の危機に一人の男が立ち上がる。
    伝説の魔剣士の血を引く悪魔狩人(デビルハンター)、その名はダンテ!」

  3. #3
    Aya Brea ... 的最愛 dominic 的大頭照
    註冊日期
    2002-01-27
    討論區文章
    1,085
    這怪怪滴ㄝ........我的access_log到了一個程度就會變成access_log.1......然後舊滴accessㄝ會自動被刪除才是.....怪怪.......

  4. #4
    皮皮您快回家
    註冊日期
    2001-11-25
    所在地區
    ADSL 8M/640K
    討論區文章
    336
    超正....這是我想要的!
    學習內容中....謝謝repsol兄...

類似的主題

  1. 【求助】請問Apache的access.log檔案~~
    作者:epeople 所在討論版:☉ -- 架 站 DIY 討 論 版
    回覆: 4
    最後發表: 2004-04-23, 01:02 PM
  2. 【求助】 如何燒錄過大的ISO檔?
    作者:yunhan 所在討論版:-- 光 碟 燒 錄 討 論 版
    回覆: 1
    最後發表: 2004-04-12, 12:38 PM
  3. 【求助】非常大的AVI檔....
    作者:ruler 所在討論版:-- 多 媒 體 討 論 版
    回覆: 4
    最後發表: 2004-04-04, 06:00 PM
  4. 【求助】奇怪的log檔,這樣的封包也可以送進來嗎?
    作者:duration 所在討論版:-- 防 駭 / 防 毒 版
    回覆: 3
    最後發表: 2002-10-25, 09:34 AM
  5. 誰家的車庫夠大的借停一下!!
    作者:tony001 所在討論版:-- 網路輕鬆版 [圖片 笑話 影片]
    回覆: 9
    最後發表: 2002-05-29, 01:59 PM

 

此網頁沒有從搜尋引擎而來的訪客

發表文章規則

  • 不可以發表新主題
  • 不可以回覆文章
  • 不可以上傳附加檔案
  • 不可以編輯自己的文章
  •