In Magento2.3, I want to maintain the custom log table when order status change.

How to achieve this?

2 Answers 2


you can use the sales_order_save_after event and observer the status and log your data in a custom table


I think there is already a table sales_order_status_history and you can access through vendor/magento/module-sales/Model/Order/Status/HistoryRepository

It does not log status change unless a comment is attached with it.

At least it will save your time in creating custom table and its files.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.