Home Database Mysql Tutorial 写mongodb日志

写mongodb日志

Jun 07, 2016 pm 05:56 PM
mongodb log

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.

  • ,免备案空间,香港服务器,美国空间
    Statement of this Website
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

    Hot Article Tags

    Notepad++7.3.1

    Notepad++7.3.1

    Easy-to-use and free code editor

    SublimeText3 Chinese version

    SublimeText3 Chinese version

    Chinese version, very easy to use

    Zend Studio 13.0.1

    Zend Studio 13.0.1

    Powerful PHP integrated development environment

    Dreamweaver CS6

    Dreamweaver CS6

    Visual web development tools

    SublimeText3 Mac version

    SublimeText3 Mac version

    God-level code editing software (SublimeText3)

    What is event ID 6013 in win10? What is event ID 6013 in win10? Jan 09, 2024 am 10:09 AM

    What is event ID 6013 in win10?

    Which version is generally used for mongodb? Which version is generally used for mongodb? Apr 07, 2024 pm 05:48 PM

    Which version is generally used for mongodb?

    Troubleshooting Event 7034 Error Log Issues in Win10 Troubleshooting Event 7034 Error Log Issues in Win10 Jan 11, 2024 pm 02:06 PM

    Troubleshooting Event 7034 Error Log Issues in Win10

    The difference between nodejs and vuejs The difference between nodejs and vuejs Apr 21, 2024 am 04:17 AM

    The difference between nodejs and vuejs

    What are the advantages of mongodb database What are the advantages of mongodb database Apr 07, 2024 pm 05:21 PM

    What are the advantages of mongodb database

    Where is the database created by mongodb? Where is the database created by mongodb? Apr 07, 2024 pm 05:39 PM

    Where is the database created by mongodb?

    Detailed explanation of log viewing command in Linux system! Detailed explanation of log viewing command in Linux system! Mar 06, 2024 pm 03:55 PM

    Detailed explanation of log viewing command in Linux system!

    What does mongodb mean? What does mongodb mean? Apr 07, 2024 pm 05:57 PM

    What does mongodb mean?

    See all articles