Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable/enable logging in Magento from database

Tags:

php

magento

I know that to enable logging through admin you can go:
System > Configuration > Advanced > Developer > Log Settings > Enable

But is there any way to enable it through database? As I don't have access to admin.

like image 468
Marvin3 Avatar asked Nov 15 '12 09:11

Marvin3


People also ask

Where are error logs Magento 2?

You can normally locate your Magento 2 error logs in {project root}\var\log\exception. log .

How do I view logs in Magento 2?

You can view the logs from the file system, the project web UI, and the magento-cloud CLI. File system—The /var/log system directory contains logs for all environments. The var/log/ directory contains app-specific logs unique to a particular environment.


2 Answers

All settings appearing in System / Configuration are stored in the core_config_data table.

The one you're searching is dev/log/active.

Be careful, in this table, you can have different values for each stores

like image 126
Jscti Avatar answered Sep 21 '22 16:09

Jscti


Change variable values in the file lib/Varien/Db/Adapter/Pdo/Mysql.php to

$_debug               = true;
$_logQueryTime        = 0.05;
$_logAllQueries       = true;
$_logCallStack        = false;
$_debugFile           = 'var/debug/pdo_mysql.log';

This will print out the sql queries

like image 28
sam Avatar answered Sep 18 '22 16:09

sam