Is there any way to watch changes in env.php file? I would like to log all changes into some file.

  • If you use GIT this file can be put in GIT and there you can easily see the changes following the commit
    – St3phan
    Oct 24, 2017 at 18:53
  • @St3phan Although this is in .gitignore, somehow it is changed. We are suspecting that somehow some extension is changing this file. Adding it into GIT will only show me what is added, or removed. I would like to see time of change. Oct 24, 2017 at 18:56

1 Answer 1


I have found this class Magento\Framework\App\DeploymentConfig\Writer. It is responsible to write configurations to env.php file. It has a saveConfig() method, and writing a before plugin for this method will do the job.

Your Answer

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

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