You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by nickva <gi...@git.apache.org> on 2017/03/17 01:30:53 UTC

[GitHub] couchdb-documentation pull request #110: Remove /_log references from the do...

Github user nickva commented on a diff in the pull request:

    https://github.com/apache/couchdb-documentation/pull/110#discussion_r106333335
  
    --- Diff: src/api/server/common.rst ---
    @@ -324,79 +324,6 @@
                 ]
             }
     
    -.. _api/server/log:
    -
    -=========
    -``/_log``
    -=========
    -
    -.. http:get:: /_log
    -    :synopsis: Returns the server log file
    -
    -    Gets the CouchDB log, equivalent to accessing the local log file of the
    -    corresponding CouchDB instance.
    -
    -    :<header Accept: - :mimetype:`text/plain`
    -    :query number bytes: Bytes to be returned. Default is ``1000``.
    -    :query number offset: Offset in bytes where the log tail should be started.
    -      Default is ``0``.
    -    :>header Content-Type: :mimetype:`text/plain; charset=utf-8`
    -    :>header Transfer-Encoding: ``chunked``
    -    :code 200: Request completed successfully
    -    :code 401: CouchDB Server Administrator privileges required
    -
    -    **Request**:
    -
    -    .. code-block:: http
    -
    -        GET /_log HTTP/1.1
    -        Accept: application/json
    -        Host: localhost:5984
    -
    -    **Response**:
    -
    -    .. code-block:: text
    -
    -        [Wed, 27 Oct 2010 10:49:42 GMT] [info] [<0.23338.2>] 192.168.0.2 - - 'PUT' /authdb 401
    -        [Wed, 27 Oct 2010 11:02:19 GMT] [info] [<0.23428.2>] 192.168.0.116 - - 'GET' /recipes/FishStew 200
    -        [Wed, 27 Oct 2010 11:02:19 GMT] [info] [<0.23428.2>] 192.168.0.116 - - 'GET' /_session 200
    -        [Wed, 27 Oct 2010 11:02:19 GMT] [info] [<0.24199.2>] 192.168.0.116 - - 'GET' / 200
    -        [Wed, 27 Oct 2010 13:03:38 GMT] [info] [<0.24207.2>] 192.168.0.116 - - 'GET' /_log?offset=5 200
    -
    -If you want to pick out specific parts of the log information you can use the
    -``bytes`` argument, which specifies the number of bytes to be returned,
    -and ``offset``, which specifies where the reading of the log should start,
    -counted back from the end. For example, if you use the following request:
    -
    -.. code-block:: http
    -
    -    GET /_log?bytes=500&offset=2000 HTTP/1.1
    -
    -Reading of the log will start at 2000 bytes from the end of the log, and 500
    -bytes will be shown.
    -
    -**How bytes/offset works?**
    -
    -CouchDB reads specified amount of ``bytes`` from the end of log file, jumping
    -to ``offset`` bytes towards the beginning of the file first:
    -
    -.. code-block:: text
    -
    -     Log File    FilePos
    -     ----------
    -    |          |  10
    -    |          |  20
    -    |          |  30
    -    |          |  40
    -    |          |  50
    -    |          |  60
    -    |          |  70 -- Bytes = 20  --
    -    |          |  80                 | Chunk
    -    |          |  90 -- Offset = 10 --
    -    |__________| 100
    -
    -.. _api/server/replicate:
    --- End diff --
    
    The deletion removed too much. Let's bring api/server/replicate part back as it's part of the next section.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---