meta-for-magento2
meta-for-magento2 copied to clipboard
No ability to prevent logs sending from Meta Extension to meta
I noticed that this extension sends a part of the logs to Meta. There is supposed to be an ability to enable/disable this functionality.
Related functionality:
- adding a log to meta flag https://github.com/magento/meta-for-magento2/blob/c1a47c7015bcb350093c9c388a95f0b55ceaa005/app/code/Meta/BusinessExtension/Helper/FBEHelper.php#L340-L344
- adding log to the queue https://github.com/magento/meta-for-magento2/blob/c1a47c7015bcb350093c9c388a95f0b55ceaa005/app/code/Meta/BusinessExtension/Logger/Handler.php#L66-L75
- message queue consumers https://github.com/magento/meta-for-magento2/blob/c1a47c7015bcb350093c9c388a95f0b55ceaa005/app/code/Meta/BusinessExtension/etc/queue_consumer.xml#L3-L4
- sending logs to meta from the queue https://github.com/magento/meta-for-magento2/blob/c1a47c7015bcb350093c9c388a95f0b55ceaa005/app/code/Meta/BusinessExtension/Helper/GraphAPIAdapter.php#L936-L967
Preconditions (*)
Steps to reproduce (*)
Expected result (*)
- [Screenshots, logs or description]
Actual result (*)
- [Screenshots, logs or description]
@nrostrow-meta
@ihor-sviziev There currently is the ability to prevent the exception logs from being sent to Meta. Though it might not be adequate so please let me know if so. The logExceptionImmediatelyToMeta function just adds 'log_type' to the context and then calls the logException function. The logException function has a check for if sending logs to Meta is enabled and if it's not enabled then the log is just made locally and is not added to the queue to be persisted to Meta.
https://github.com/magento/meta-for-magento2/blob/3ba54355fa5b1efd867ee0b59787e917efd9ab66/app/code/Meta/BusinessExtension/Helper/FBEHelper.php#L306-L311
Enabling/disabling persisting exception logs to Meta can be controlled by updating the meta_exception_logging_enabled config value.
https://github.com/magento/meta-for-magento2/blob/3ba54355fa5b1efd867ee0b59787e917efd9ab66/app/code/Meta/BusinessExtension/etc/config.xml#L11
Currently this config value isn't shown in the UI though and can only be modified in code. By default the value is set to true to enable persisting exception logs to Meta. The reason for this is that the exception logging is pretty critical for us to be able to identify and diagnose issues with the extension so we were afraid that if we showed it in the UI that sellers would turn it off by default.
https://github.com/magento/meta-for-magento2/blob/3ba54355fa5b1efd867ee0b59787e917efd9ab66/app/code/Meta/BusinessExtension/etc/adminhtml/system.xml#L48-L53
Is this acceptable or does disabling sending exception logs to Meta need to be prevalent in the UI? Thanks!
@ihor-sviziev -- if this is acceptable, do you mind resolving this issue?
Closing the issue since the interim solution is available: setting facebook/business_extension/meta_exception_logging_enabled to 0 will disable sending exception logs to Meta.