首頁 資料庫 mysql教程 写mongodb日志

写mongodb日志

Jun 07, 2016 pm 05:56 PM
mongodb 紀錄

The following steps create and rotate a log file: Start awith verbose logging, with appending enabled, and with the following log file: mongod -v --logpath /var/log/mongodb/server1.log --logappend In a separate terminal, list the matching

The following steps create and rotate a log file:

  • Start a  with verbose logging, with appending enabled, and with the following log file:

    mongod -v --logpath /var/log/mongodb/server1.log --logappend

  • In a separate terminal, list the matching files:

    ls /var/log/mongodb/server1.log*

    For results, you get:

  • Rotate the log file using one of the following methods.

  • From the  shell, issue the  command from the admin database:

    This is the only available method to rotate log files on Windows systems.

  • From the UNIX shell, rotate logs for a single process by issuing the following command:

  • From the UNIX shell, rotate logs for all  processes on a machine by issuing the following command:

  • List the matching files again:

    ls /var/log/mongodb/server1.log*

    For results you get something similar to the following. The timestamps will be different.

    server1.log server1.log.2011-11-24T23-30-00

    The example results indicate a log rotation performed at exactly 11:30 pm on November 24th, 2011 UTC, which is the local time offset by the local time zone. The original log file is the one with the timestamp. The new log is server1.log file.

    If you issue a second  command an hour later, then an additional file would appear when listing matching files, as in the following example:

    server1.log server1.log.2011-11-24T23-30-00 server1.log.2011-11-25T00-30-00

    This operation does not modify the server1.log.2011-11-24T23-30-00 file created earlier, while server1.log.2011-11-25T00-30-00 is the previous server1.log file, renamed. server1.log is a new, empty file that receives all new log output.

  • ,免备案空间,香港服务器,美国空间
    本網站聲明
    本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn

    熱AI工具

    Undresser.AI Undress

    Undresser.AI Undress

    人工智慧驅動的應用程序,用於創建逼真的裸體照片

    AI Clothes Remover

    AI Clothes Remover

    用於從照片中去除衣服的線上人工智慧工具。

    Undress AI Tool

    Undress AI Tool

    免費脫衣圖片

    Clothoff.io

    Clothoff.io

    AI脫衣器

    AI Hentai Generator

    AI Hentai Generator

    免費產生 AI 無盡。

    熱門文章

    R.E.P.O.能量晶體解釋及其做什麼(黃色晶體)
    2 週前 By 尊渡假赌尊渡假赌尊渡假赌
    倉庫:如何復興隊友
    4 週前 By 尊渡假赌尊渡假赌尊渡假赌
    Hello Kitty Island冒險:如何獲得巨型種子
    3 週前 By 尊渡假赌尊渡假赌尊渡假赌

    熱工具

    記事本++7.3.1

    記事本++7.3.1

    好用且免費的程式碼編輯器

    SublimeText3漢化版

    SublimeText3漢化版

    中文版,非常好用

    禪工作室 13.0.1

    禪工作室 13.0.1

    強大的PHP整合開發環境

    Dreamweaver CS6

    Dreamweaver CS6

    視覺化網頁開發工具

    SublimeText3 Mac版

    SublimeText3 Mac版

    神級程式碼編輯軟體(SublimeText3)

    win10的事件ID 6013是什麼? win10的事件ID 6013是什麼? Jan 09, 2024 am 10:09 AM

    win10的事件ID 6013是什麼?

    mongodb一般用哪個版本 mongodb一般用哪個版本 Apr 07, 2024 pm 05:48 PM

    mongodb一般用哪個版本

    解決Win10中的事件7034錯誤日誌問題 解決Win10中的事件7034錯誤日誌問題 Jan 11, 2024 pm 02:06 PM

    解決Win10中的事件7034錯誤日誌問題

    nodejs和vuejs區別 nodejs和vuejs區別 Apr 21, 2024 am 04:17 AM

    nodejs和vuejs區別

    mongodb建立的資料庫在哪裡 mongodb建立的資料庫在哪裡 Apr 07, 2024 pm 05:39 PM

    mongodb建立的資料庫在哪裡

    mongodb資料庫的優勢有哪些 mongodb資料庫的優勢有哪些 Apr 07, 2024 pm 05:21 PM

    mongodb資料庫的優勢有哪些

    Linux系統查看log日誌指令詳解! Linux系統查看log日誌指令詳解! Mar 06, 2024 pm 03:55 PM

    Linux系統查看log日誌指令詳解!

    mongodb是什麼意思 mongodb是什麼意思 Apr 07, 2024 pm 05:57 PM

    mongodb是什麼意思

    See all articles