REST changes around logging

This commit is contained in:
Jakob Borg
2015-10-27 08:46:51 +01:00
parent a40ee17ea3
commit ecb7d0bb51
4 changed files with 68 additions and 2 deletions

34
rest/system-debug-get.rst Normal file
View File

@@ -0,0 +1,34 @@
GET /rest/system/debug
======================
.. versionadded:: 0.12.0
Returns the set of debug facilities and which of them are currently enabled.
.. code-block:: json
{
"enabled": [
"beacon"
],
"facilities": {
"beacon": "Multicast and broadcast discovery",
"config": "Configuration loading and saving",
"connections": "Connection handling",
"db": "The database layer",
"dialer": "Dialing connections",
"discover": "Remote device discovery",
"events": "Event generation and logging",
"http": "REST API",
"main": "Main package",
"model": "The root hub",
"protocol": "The BEP protocol",
"relay": "Relay connection handling",
"scanner": "File change detection and hashing",
"stats": "Persistent device and folder statistics",
"sync": "Mutexes",
"upgrade": "Binary upgrades",
"upnp": "UPnP discovery and port mapping",
"versioner": "File versioning"
}
}

View File

@@ -0,0 +1,13 @@
POST /rest/system/debug
=======================
.. versionadded:: 0.12.0
Enables or disables debugging for specified facilities. Give one or both of
``enable`` and ``disable`` query parameters, with comma separated facility
names. To disable debugging of the beacon and discovery packages, and enable it
for config and db:
.. code-block:: bash
$ curl -H X-API-Key:abc123 -X POST 'http://localhost:8385/rest/system/debug?disable=beacon,discovery&enable=config,db'

View File

@@ -1,6 +1,8 @@
GET /rest/system/error
======================
.. note:: Return format changed in 0.12.0.
Returns the list of recent errors.
.. code-block:: json
@@ -8,8 +10,8 @@ Returns the list of recent errors.
{
"errors": [
{
"time": "2014-09-18T12:59:26.549953186+02:00",
"error": "This is an error string"
"when": "2014-09-18T12:59:26.549953186+02:00",
"message": "This is an error string"
}
]
}

17
rest/system-log-get.rst Normal file
View File

@@ -0,0 +1,17 @@
GET /rest/system/log
====================
.. versionadded:: 0.12.0
Returns the list of recent log entries.
.. code-block:: json
{
"messages": [
{
"when": "2014-09-18T12:59:26.549953186+02:00",
"message": "This is a log entry"
}
]
}