Logging

In addition to the command arguments described in this topic, see Common arguments.

Run all Magento CLI commands as the Magento file system owner.

Debug logging

By default, Magento writes debug logs to the var/log/debug.log file inside the Magento application directory.

To enable debug logging:

  1. Use the config:set command to change the dev/debug/debug_logging database value to 1.

     bin/magento config:set dev/debug/debug_logging 1
    
  2. Flush the cache.

     bin/magento cache:flush
    

To disable debug logging:

  1. Use the config:set command to change the dev/debug/debug_logging database value to 0.

     bin/magento config:set dev/debug/debug_logging 0
    
  2. Flush the cache.

     bin/magento cache:flush
    

Database logging

By default, Magento writes database activity logs to the var/debug/db.log file inside the Magento application directory.

To enable database logging:

  1. Use the dev:query-log command to enable or disable database logging.

     bin/magento dev:query-log:enable
    
     bin/magento dev:query-log:disable
    
  2. Flush the cache.

     bin/magento cache:flush