Disabling the log files in PM 3.1 and later

Unofficial documentation how to do interesting things and work around problems in ProcessMaker

Moderator: amosbatto

Forum rules
Unofficial documentation for features which have not been tested by Quality Assurance or may change in future versions of ProcessMaker
amosbatto
Posts: 5564
Joined: Mon Jun 22, 2009 10:28 am
Country: Bolivia
Location: La Paz

Disabling the log files in PM 3.1 and later

Unread postby amosbatto » Thu Dec 07, 2017 12:16 am

ProcessMaker added a new logging feature in version 3.1 and later to document every action taken by ProcessMaker. The log files are located at:
{install-directory}/processmaker/shared/sites/{workspace}/log/processmaker-YYYY-MM-DD.log
For example:
/opt/processmaker/shared/sites/workflow/log/processmaker-2017-09-19.log

This new logging is useful if your organization needs auditing of actions in ProcessMaker, but it also slows down ProcessMaker and consumes a large amount of disk space on the server.

If wishing to turn off the new logging, then edit the file {install-directory}/processmaker/gulliver/system/class.bootstrap.php with a plain text editor.
Changes lines 2945 - 2951 from:

Code: Select all

    public static function registerMonolog($channel, $level, $message, $context, $ws, $file = 'cron.log', $pathData = PATH_DATA)
    {
        $fileLog = $pathData .'sites'. PATH_SEP . $ws . PATH_SEP . 'log' . PATH_SEP . $file;

        $registerLogger = &MonologProvider::getSingleton($channel, $fileLog);
        $registerLogger->addLog($level, $message, $context);
    }

To:

Code: Select all

    public static function registerMonolog($channel, $level, $message, $context, $ws, $file = 'cron.log', $pathData = PATH_DATA)
    {
        $fileLog = $pathData .'sites'. PATH_SEP . $ws . PATH_SEP . 'log' . PATH_SEP . $file;

        //$registerLogger = &MonologProvider::getSingleton($channel, $fileLog);
        //$registerLogger->addLog($level, $message, $context);
    }

Now ProcessMaker won't add content to the log files.
Amos B. Batto ♦ ProcessMaker Technical Documentation Writer & Forum Manager ♦ Cofounder of ILLA (http://www.illa-a.org)

User avatar
programerboy
Posts: 68
Joined: Mon Aug 28, 2017 4:22 am
Country: Iran
Location: Iran, Mashhad

Re: Disabling the log files in PM 3.1 and later

Unread postby programerboy » Thu Dec 07, 2017 12:24 am

Thanks Amos

amosbatto
Posts: 5564
Joined: Mon Jun 22, 2009 10:28 am
Country: Bolivia
Location: La Paz

Re: Disabling the log files in PM 3.1 and later

Unread postby amosbatto » Thu Dec 07, 2017 1:39 am

If you want logging to be configurable from the env.ini file, then edit processmaker/workflow/engine/classes/class.system.php and change lines 52-84 from:

Code: Select all

    private static $defaultConfig = array(
        'debug' => 0,
        'debug_sql' => 0,
        'debug_time' => 0,
        'debug_calendar' => 0,
        'wsdl_cache' => 1,
        'memory_limit' => "256M",
        'time_zone' => 'America/New_York',
        'expiration_year' => '1',
        'memcached' => 0,
        'memcached_server' => '',
        'default_skin' => 'neoclassic',
        'default_lang' => 'en',
        'proxy_host' => '',
        'proxy_port' => '',
        'proxy_user' => '',
        'proxy_pass' => '',
        'size_log_file' => 5000000,
        'number_log_file' => 5,
        'ie_cookie_lifetime' => 1,
        'safari_cookie_lifetime' => 1,
        'error_reporting' => "",
        'display_errors' => 'On',
        'enable_blacklist' => 0,
        'system_utc_time_zone' => 0,
        'server_protocol' => '',
        'leave_case_warning' => 0,
        'server_hostname_requests_frontend' => '',
        'load_headers_ie' => 0,
        'redirect_to_mobile' => 0,
        'disable_php_upload_execution' => 0,
        'disable_download_documents_session_validation' => 0
    
);
 

To:

Code: Select all

    private static $defaultConfig = array(
        'debug' => 0,
        'debug_sql' => 0,
        'debug_time' => 0,
        'debug_calendar' => 0,
        'wsdl_cache' => 1,
        'memory_limit' => "256M",
        'time_zone' => 'America/New_York',
        'expiration_year' => '1',
        'memcached' => 0,
        'memcached_server' => '',
        'default_skin' => 'neoclassic',
        'default_lang' => 'en',
        'proxy_host' => '',
        'proxy_port' => '',
        'proxy_user' => '',
        'proxy_pass' => '',
        'log_file'   => 'all',
        'size_log_file' => 5000000,
        'number_log_file' => 5,
        'ie_cookie_lifetime' => 1,
        'safari_cookie_lifetime' => 1,
        'error_reporting' => "",
        'display_errors' => 'On',
        'enable_blacklist' => 0,
        'system_utc_time_zone' => 0,
        'server_protocol' => '',
        'leave_case_warning' => 0,
        'server_hostname_requests_frontend' => '',
        'load_headers_ie' => 0,
        'redirect_to_mobile' => 0,
        'disable_php_upload_execution' => 0,
        'disable_download_documents_session_validation' => 0
    
);
 


Then, edit processmaker/gulliver/system/class.bootstrap.php and change lines 2945-2951 from:

Code: Select all

    public static function registerMonolog($channel, $level, $message, $context, $ws, $file = 'cron.log', $pathData = PATH_DATA)
    {
        $fileLog = $pathData .'sites'. PATH_SEP . $ws . PATH_SEP . 'log' . PATH_SEP . $file;

        $registerLogger = &MonologProvider::getSingleton($channel, $fileLog);
        $registerLogger->addLog($level, $message, $context);
    

To:

Code: Select all

    public static function registerMonolog($channel, $level, $message, $context, $ws, $file = 'cron.log', $pathData = PATH_DATA)
    {
        $fileLog = $pathData .'sites'. PATH_SEP . $ws . PATH_SEP . 'log' . PATH_SEP . $file;
        $aSysConf = \System::getSystemConfiguration();

        if ($aSysConf['log_file'] == 'all' or $aSysConf['log_file'] == '' or
           
($aSysConf['log_file'] == 'errors' and $level >= 400)) 
        
{
            $registerLogger = &MonologProvider::getSingleton($channel, $fileLog);
            $registerLogger->addLog($level, $message, $context);
        }
    


Then, you can edit your workflow/engine/config/env.ini file and add one of the following lines to set the level of logging:

Code: Select all

logging = "off"
logging = "all"
logging = "errors"
Amos B. Batto ♦ ProcessMaker Technical Documentation Writer & Forum Manager ♦ Cofounder of ILLA (http://www.illa-a.org)

User avatar
programerboy
Posts: 68
Joined: Mon Aug 28, 2017 4:22 am
Country: Iran
Location: Iran, Mashhad

Re: Disabling the log files in PM 3.1 and later

Unread postby programerboy » Fri Dec 08, 2017 8:47 am

Hi,
Please tell to processmaker team for create these changes to next version.
Thanks

amosbatto
Posts: 5564
Joined: Mon Jun 22, 2009 10:28 am
Country: Bolivia
Location: La Paz

Re: Disabling the log files in PM 3.1 and later

Unread postby amosbatto » Fri Dec 08, 2017 10:09 pm

programerboy wrote:Hi,
Please tell to processmaker team for create these changes to next version.
Thanks

I filed a bug report about it: https://processmaker.atlassian.net/browse/TRI-2461
Amos B. Batto ♦ ProcessMaker Technical Documentation Writer & Forum Manager ♦ Cofounder of ILLA (http://www.illa-a.org)


Return to “Tips and Tricks”

Who is online

Users browsing this forum: No registered users and 1 guest