首页 > 数据库 > mysql教程 > 写mongodb日志

写mongodb日志

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
发布: 2016-06-07 17:56:15
原创
1005 人浏览过

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.

  • ,免备案空间,香港服务器,美国空间
    相关标签:
    来源:php.cn
    本站声明
    本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
    最新问题
    mongodb启动
    来自于 1970-01-01 08:00:00
    0
    0
    0
    linux - ubuntu14安装mongodb出错
    来自于 1970-01-01 08:00:00
    0
    0
    0
    symfony2 mongodb的使用
    来自于 1970-01-01 08:00:00
    0
    0
    0
    mac上配置mongodb 错误
    来自于 1970-01-01 08:00:00
    0
    0
    0
    mongodb的参数理解
    来自于 1970-01-01 08:00:00
    0
    0
    0
    热门教程
    更多>
    最新下载
    更多>
    网站特效
    网站源码
    网站素材
    前端模板