Where is the Detailed Logging setting stored?
It's in civicrm_setting but if it's never been turned on it won't be there. But also it's more than just a setting - you would need to rebuild the schema and triggers.
If you have cv installed you can do cv ev &quot;Civi::settings()-&gt;set('logging', 1); $s = new CRM_Logging_Schema(); $s-&gt;enableLogging();&quot; to do it from the command line manually.