Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Send all debug info ONLY to file log

  • jackrabbithanna
  • jackrabbithanna's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
2 years 3 months ago #223144 by jackrabbithanna
Send all debug info ONLY to file log was created by jackrabbithanna
I know about how to enable debug information, where PHP notices/warnings/errors and query logs can be written out to the screen.

I also know how to enable a file log, and have that information also be written to it.

What I want to do is have debug information only go to the file log, and not display on the screen or be part of an ajax/api response.

I've played with various combinations of configuring logs, like in config.php, in the 'components' section
Code:
'log' => array(
          'routes' => array(
 
            'info' => array(
              'class'=>'CFileLogRoute',
              'levels'=>'trace, info',
              'categories'=>'system.*',
            ),
            'allError' => array(
              'class' => 'CFileLogRoute',
              'levels' => 'warning, error',
            ),
            // also tried this below, by itself
            /*'allInfo' => array(
              'class'=>'CFileLogRoute',
              //'levels'=>'trace, info',
              //'categories'=>'system.*',
            ),*/
          )
        ),

and
Code:
'config'=>array(
        'debug'=>2, // or 1 for only warnings/errors
        'debugsql'=>1, // Set this to 1 to enanble sql logging, only active when debug = 2
        // 'force_xmlsettings_for_survey_rendering' => true, // Uncomment if you want to force the use of the XML file rather than DB (for easy theme development)
        // 'use_asset_manager'=>true, // Uncomment if you want to use debug mode and asset manager at the same time
    )

Which works, and debug information does get written to a ./tmp/runtime/application.log file.

But the information still displays on the screen. And for us includes information in ajax API request.

Is it possible to only have debug information go to the log?

Thanks in advance!
 
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 3 months ago - 2 years 3 months ago #223187 by DenisChenu
Replied by DenisChenu on topic Send all debug info ONLY to file log
You must replace the default log for tracevar in your config fil.

github.com/LimeSurvey/LimeSurvey/blob/91...ternal.php#L167-L171

Code:
'vardump' => array(
'class' => 'CFileLogRoute',
),

or
Code:
'vardump' => array(
'enabled' => 0,
),

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Last edit: 2 years 3 months ago by DenisChenu.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose