Details
-
Type: Improvement
-
Status: Open
-
Priority: Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Epic Link:
Description
Use monolog to log activity in an Info log (see RFC 5424) to the database, and display this content in the staff UI.
This would require:
- PHP 5.3+ (i.e. Blesta 4+)
- A custom monolog process to acquire data necessary for logging, based on, or extended from, the bundled 'WebProcessor'
- A custom monolog handler to properly log that data to a MySQL database
- Model for display the log records
- UI for displaying under Logs as well as under the client's profile
log_info
- id (Auto increment ID for the entry)
- company_id (The ID of the company the action was triggered under)
- channel (The channel the action occurred under,. e.g. 'general', but may include 'module', 'gateway', 'plugin', etc. in the future)
- client_id (Client ID that the action relates to, if any)
- user_id (User that performed the action that triggered the log entry)
- user_ip (User's IP address)
- message (A JSON encoded string of message and context data)
- date_added
PK: id
Key: client_id
Key: user_id, company_id
Key: company_id, channel, user_ip
The message of a log would contain JSON encoded data. For example, if a client changes their login password the message might be stored as:
{ "message": "Client #{{id_code}} updated user password.", "context": { "id_code": 123, "id": 20 }
And displayed as: Client #123 updated user password.