Changeset 629


Ignore:
Timestamp:
May 13, 2018 3:23:03 PM (6 years ago)
Author:
anonymous
Message:

Add log_serialize parameter

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/docs/version.txt

    r624 r629  
    1 2.2.2-0
     12.2.2-2
  • trunk/lib/App.inc.php

    r623 r629  
    195195        'log_message_max_length' => 1024,
    196196
     197        // Strip line-endings from log messages.
     198        'log_serialize' => true,
     199
    197200        // Temporary files directory.
    198201        'tmp_dir' => '/tmp',
     
    394397                        $this->setParam(json_decode(file_get_contents($db_auth_file), true));
    395398                    } else {
    396                         $this->logMsg(sprintf('Unable to read DB auth file: %s', $db_auth_file), LOG_ALERT, __FILE__, __LINE__);
     399                        $this->logMsg(sprintf('Unable to read DB auth file: %s', $db_auth_file), LOG_NOTICE, __FILE__, __LINE__);
    397400                    }
    398401                } else {
    399                     $this->logMsg(sprintf('DB auth file not found: %s', $this->getParam('db_auth_file')), LOG_ALERT, __FILE__, __LINE__);
     402                    $this->logMsg(sprintf('DB auth file not found: %s', $this->getParam('db_auth_file')), LOG_NOTICE, __FILE__, __LINE__);
    400403                }
    401404            }
     
    811814        }
    812815
    813         // Strip HTML tags except any with more than 7 characters because that's probably not a HTML tag, e.g. <email@address.com>.
    814         preg_match_all('/(<[^>\s]{7,})[^>]*>/', $message, $strip_tags_allow);
    815         $message = strip_tags(preg_replace('/\s+/', ' ', $message), (!empty($strip_tags_allow[1]) ? join('> ', $strip_tags_allow[1]) . '>' : null));
    816 
    817         // Serialize multi-line messages.
    818         $message = preg_replace('/\s+/m', ' ', trim($message));
     816        if ($this->getParam('log_serialize')) {
     817            // Serialize multi-line messages.
     818            $message = preg_replace('/\s+/m', ' ', trim($message));
     819        }
    819820
    820821        // Store this event under a unique key, counting each time it occurs so that it only gets reported a limited number of times.
Note: See TracChangeset for help on using the changeset viewer.