The service permits to store and search a log. A log is composed from a set of optional values (text message, a duration of an operation) plus some metainformation (application Id, session Id, datetime of operation).
Save a log message on the service
No permission needed
appId
(path variable) : application identifier [mandatory | STRING].msg
(JSON request body element) : log message [optional | STRING]. If not specified, the value of type
is taken.appId
(JSON request body) : application identifier [optional | STRING].Value is set always override by appId path variable.
type
(JSON request body): type of log message [mandatory | STRING]. Specific to the logging component or application.duration
(JSON request body) : duration of application operation [optional | DOUBLE].session
(JSON request body): identifier of application session [optional | STRING].timestamp
(JSON request body): timestamp of operation [optional | NUMBER]. Value is setted to current if field is missing.
custom_attr
(JSON request body): map of key/value representing custom attribute to current log message. Accepted values can be numbers or strings.POST /welive.logging/log/{appId} Host: dev.smartcommunitylab.it Content-type: application/json { "msg":"logging test", "appId":"9001", "type":"AppCustom", "duration":0.1, "session":"avbfsr3k4", "timestamp":34839043490890482390 "custom_attr": {"rating":1.2, "deviceId":"aaacckfkk334"} }
Returns the paginate list of result matching query criteria.
No permission needed
appId
(path variable) : application identifier [mandatory | STRING].from
(query param) : Timerange start. Express it in millis [optional | INTEGER]to
(query param) : Timerange end. Express it in millis [optional | INTEGER]type
(query param) : log type to search [optional | STRING]pattern
(query param) : search criteria on custom fields using Lucene syntax [optional | STRING]. Put in logical AND clause with msgPattern if present.msgPattern
(query param): search the pattern in log text [optional | STRING]. Put in logical AND clause with pattern if present.limit
(query param) : maximum number of messages to return [optional | INTEGER]. Default value is 150offset
(query param) : index of first message to return [optional | INTEGER]. Default value is 0GET /welive.logging/log/{appId} Host: dev.smartcommunitylab.it Accept: application/json
{ "offset": 0, "limit": 150, "data": [ { "appId": "wer123", "type": "AppStart", "msg": "appstart logging", "timestamp": 1444732794782, "custom_attr":{} }, { "appId": "wer123", "type": "AppCustom", "msg": "log with invalid type", "timestamp": 1444732732318, "custom_attr":{} } ], "total_results": 2 }
Returns the number of result matching the query criteria
No permission needed
appId
(path variable) : application identifier [mandatory | STRING].from
(query param) : Timerange start. Express it in millis [optional | INTEGER]to
(query param) : Timerange end. Express it in millis [optional | INTEGER]type
(query param) : log type to search [optional | STRING]pattern
(query param) : search criteria on custom fields using Lucene syntax [optional | STRING]. Put in logical AND clause with msgPattern if present.msgPattern
(query param): search the pattern in log text [optional | STRING]. Put in logical AND clause with pattern if present.limit
(query param) : maximum number of messages to return [optional | INTEGER]. Default value is 150offset
(query param) : index of first message to return [optional | INTEGER]. Default value is 0GET /welive.logging/log/count/{appId} Host: dev.smartcommunitylab.it Accept: application/json
{ "total_results": 2 }
Return one or more elasticsearch aggregation(s). See https://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html and https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations.html
No permission needed
request
(JSON request body) : An elasticsearch search query [mandatory | STRING].POST /welive.logging/log/aggregate Host: dev.smartcommunitylab.it Content-type: application/json { "_source" : false, "size" : 0, "aggs" : { "agg1" : { "sampler" : { "field" : "message" } } } }
{ "took": 14, "timed_out": false, "_shards": { "total": 5, "successful": 5, "failed": 0 }, "hits": { "total": 1564, "max_score": 0, "hits": [] }, "aggregations": { "agg1": { "doc_count": 0 } } }