Is there a way to turn on/off the logging with setting a variable in config file in SilverStripe 3.X (CWP 1.8)?

74
February 13, 2019, at 11:10 PM

We are building a web application with CWP 1.8 which is upon SilverStripe 3.6, the log will be captured by SS_Log class with statement like SS_Log::log('Log message', SS_Log::INFO);. As we only need to capture the log for debugging purpose when the error happens, so we would like to make the logger more flexible that it can be controlled with a variable in the config file. In other words, we need to turn on the logging when the error produced and turn off the logging once the error sorted.

Can anyone give us some directions to achieve that? Thanks so much

SilverStripe 3.6

READ ALSO
How to include all php files in Nginx's rewrite rule?

How to include all php files in Nginx's rewrite rule?

What I'm trying to do is allow any of the following to work:

75
Append php loop data to JSON object

Append php loop data to JSON object

I need looped php data in an html template so I know it has something to do with JSON however not a JSON expert and cannot find much help in searching the web

57
Warning: Declaration of My_Walker_Nav_Menu

Warning: Declaration of My_Walker_Nav_Menu

WP 5x started displaying this error code

73
preg match not taking large letter number combo

preg match not taking large letter number combo

Preg match will not accept example: Swbermanoo0292I also would like to allow quotes but cannot figure how to do so

60