Skip to content

It's not possible to enable "log to file" (debugging) in production mode #11882

@LucaGallinari

Description

@LucaGallinari

It's not possible to change the "dev/debug/debug_logging" sys config field while in production mode. It should definitely be set to "No" as default (like when switching from developer/default to production) but you should be allowed to change this value even while in production mode.

Preconditions

  1. Magento version 2.2 (dunno with other versions)

Steps to reproduce

  1. Switch to production mode

Expected result

  1. From the admin, go into "Stores/Configuration/Advanced/Developer/Debug/Log to file"
  2. Try to change the dropdown value, but you can't because the input is disabled

Actual result

  1. From the admin, go into "Stores/Configuration/Advanced/Developer/Debug/Log to file"
  2. You can change the dropdown value

Insights

In Magento\Deploy\etc\di.xml there is this entry:

...
<type name="Magento\Deploy\App\Mode\ConfigProvider">
    <arguments>
        <argument name="config" xsi:type="array">
            <item name="developer" xsi:type="array">
                <item name="production" xsi:type="array">
                    <item name="dev/debug/debug_logging" xsi:type="string">0</item>
                </item>
            </item>
        </argument>
    </arguments>
</type>
...

that writes this

...
'system' => array (
    'default' => array (
        'dev' => array (
            'debug' => array (
                'debug_logging' => '0',
            ),
        ),
    ),
),
...

in the env.php. The presence of this entry on the env.php disables the related input in the admin panel.

MOREOVER, if you switch from production to developer mode the entry will not be removed and so you can't change the value of the input, even if you are now in developer mode.

Metadata

Metadata

Assignees

Labels

Fixed in 2.2.xThe issue has been fixed in 2.2 release lineFixed in 2.3.xThe issue has been fixed in 2.3 release lineIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions