# Log
Payload definition
key | type | required | description |
---|---|---|---|
message | string | Y | full log text |
context | string | additional log context, should be free-form json in string |
Preview
{
"message": "User X is logged in admin panel",
"context": "{\"user_id\": 12345}"
}
# Server recommendations
- DO NOT add date-time to message prefix. For example "
[14:12:20] Hello world
".
# Client rules
- Use different colors for different log levels, for example red for "errors", blue for "info", etc..
- Display log context in read-only text field
- Truncate context to max 4096 symbols
# Client recommendations
- Highlight context field as JSON
- Hide context by default and show only after user click on log
# importance map table (mapped level to int)
property importance
can by int
[from 1 to 8]
, so you need to map log levels
to event importance
level | importance | description |
---|---|---|
debug | 1 | Detailed debug information |
info | 2 | Interesting events. Examples: User logs in |
notice | 3 | Normal but significant events |
warning | 4 | Exceptional occurrences that are not errors. Examples: Use of deprecated APIs, poor use of an API, undesirable things that are not necessarily wrong |
error | 5 | Runtime errors that do not require immediate action but should typically be logged and monitored |
critical | 6 | Critical conditions. Example: Application component unavailable, unexpected exception |
alert | 7 | Action must be taken immediately. Example: Entire website down, database unavailable, etc. This should trigger the SMS alerts and wake you up |
emergency | 8 | Emergency: system is unusable |
# Query
Payload definition
key | type | required | description |
---|---|---|---|
target | string | Y | query target, for example db, io, cache or service name (mysql, influxdb, redis, rabbitmq, etc..). Used in client for group all request to same service |
query | string | Y | request query string |
syntax | string | syntax for query highlight in client Allowed values:
|
Preview
{
"target": "mysql",
"query": "SELECT * FROM articles WHERE ID = 2;",
"syntax": "sql"
}
# Client rules
- Display total execution duration/count for all queries by each
target
. For example:- target
mysql
7 requests, total 210 ms. - target
redis
12 requests, total 64 ms.
- target
# Client recommendations
- Highlight
query
by file type defined insyntax
field. If fieldsyntax
is not set, do not highlight query. - hide full query under cut, if length of
query
field is >= 512 chars
# Request
Payload definition
key | type | required | description |
---|---|---|---|
method | method | request HTTP method | |
uri | uri | full request uri | |
headers | param[] | list of received request headers | |
query | param[] | list of received request query (GET) params | |
body | param[] | list of received request body (POST) params | |
cookies | param[] | list of received request cookies | |
session | param[] | loaded session params |
Preview
{
"method": "POST",
"uri": "/api/hello?foo=bar",
"headers": [
{
"key": "accept",
"value": "text/html"
},
{
"key": "cache-control",
"value": "no-cache"
}
],
"query": [
{
"key": "foo",
"value": "bar"
}
],
"body": [
{
"key": "foo",
"value": "bar"
}
],
"cookies": [
{
"key": "PHPSESS",
"value": "l6q632qbzua97o3p2p71biefbkrijbil"
},
{
"key": "_ym_uid",
"value": "15356948596"
}
],
"session": [
{
"key": "userid",
"value": 21114
},
{
"key": "views_count",
"value": 23
}
]
}
# Response
Payload definition
key | type | required | description |
---|---|---|---|
memoryPeak | byte | max/peak memory usage (in bytes) during request |
Preview
{
"memoryPeak": 1024
}
# Server rules
- Use
duration
field for total request time
# Middleware
Payload definition
key | type | required | description |
---|---|---|---|
name | string | Y | Middleware name |
Preview
{
"name": "\\Illuminate\\Routing\\Middleware\\ThrottleRequests"
}
# Template
Payload definition
key | type | required | description |
---|---|---|---|
name | string | Y | executed/rendered template name |
Preview
{
"name": "/resources/templates/header.twig"
}
Payload definition
key | type | required | description |
---|---|---|---|
subject | string | Y | mail subject (title) |
body | html | Y | email content (html or plain text) |
from | string | Y | sender email address |
to | string[] | Y | to email addresses |
cc | string[] | CC addresses | |
bcc | string[] | BCC addresses | |
replyTo | string | reply-to target email address | |
attachments | string[] | list of attachment file names (without actual content) |
Preview
{
"subject": "Welcome to our forum",
"body": "Hello John
Now you are member of our great C++ community!
",
"from": "no-reply@example.com",
"to": [
"john_doe@example.com",
"admin@example.com"
],
"cc": [
"john_doe@example.com",
"admin@example.com"
],
"bcc": [
"john_doe@example.com",
"admin@example.com"
],
"replyTo": "contact@forum.example.com",
"attachments": [
"payment-info.pdf"
]
}
# Client recommendations
- Use editor with html syntax highlight for body
- If possible add preview mode for body with rendered html
# Event
Payload definition
key | type | required | description |
---|---|---|---|
name | string | Y | Called event name (listener class, id, etc..) |
group | string | Helpful if you want split event by logic groups (kernel, loader, app, etc..) |
Preview
{
"name": "ConsoleHandler::onCommand",
"group": "kernel"
}
# Access Check
Access checking based on ACO (Access control objects) or ACL (access control list).
Payload definition
key | type | required | description |
---|---|---|---|
access | aclVote | Y | result of checking permission (GRANT/DENIED) |
control | string | Y | name of object with restricted access |
object | string | name of requester object (who want get restricted access) | |
action | string | name of required action |
Preview
{
"access": "GRANT",
"control": "Engines",
"object": "R2-D2",
"action": "publish"
}
# For example:
Who/Where | Cockpit | Lounge | Guns | Engines |
---|---|---|---|---|
Han | Y | Y | Y | Y |
Chewie | Y | Y | Y | |
Obi-wan | Y | |||
Luke | Y | |||
R2-D2 | Y | |||
C3PO | Y |
can R2-D2
access to Cockpit
?
{
"access": "DENIED",
"control": "Cockpit",
"object": "R2-D2"
}
can R2-D2
access to Engines
?
{
"access": "GRANT",
"control": "Engines",
"object": "R2-D2"
}
can user admin
access to publish
object article helloWorld
?
{
"access": "GRANT",
"control": "article:helloWorld",
"object": "user:admin",
"action": "publish"
}
# How to use this with votes system
You can add votes mapped by access (GRANT = vote up, DENIED = vote down),
Final result of voting can be added with higher importance