Logs Service
Log Service of Pharmacity. This service save all log in mongodb.
Flow
Entity
Each line of the log has multiple entities that identify it, such as order number, order ID, tracking number, etc. These keys can serve as identifiers for individual log lines. Therefore, the service utilizes a list of entity objects to define these keys.
"entity": [
{
"type" : "order_number",
"value": "6368367886"
},
{
"type" : "order_id",
"value": "308921"
}
],
If there is no key for a log, the service sets the entity value to 'system-{date}', for example, 'pmc-ecm-delivery-api-2023-09-15'. The service automatically tracks entities related to each order. So, when you search for a tracking number, you also retrieve the log entries associated with the order number for that specific order.
Storage
The logs database is divided into multiple collections based on time, such as 'log-2023-07-01' and 'log-2023-07-15,' to make maintenance easier. There is also an 'entity_collection' table that maps each entity to a collection name, allowing us to search for logs efficiently.
Host
Directly: https://pmc-ecm-logs-api.dev.pharmacity.io
Gateway: https://api-gateway.dev.pharmacity.io/pmc-ecm-logs-api