I’ve previously created a very simple module for SuiteCRM which adds coloured logging (SuiteCRM Colour Logger). I’ve now expanded it somewhat to add extra features.
It’s now called SuiteSuperLogger and allows specifying the log format in the config.
Enabling coloured logging can be done by adding
$sugar_config['suitesuperlogger']['colour'] = true;
To the config.
Altering the log format can be done by adding the following to
$sugar_config['suitesuperlogger']['format'] = ':date:[:pid:][:userId:][:level:][:remoteAddr:][:forwardedAddr:][:requestMethod:]:msg:';
The following placeholders are accepted and will be replaced with an appropriate value:
- The date the message was logged
- The process id
- The logged in user id
- The log level
- The remote address as found in the PHP \$_SERVER superglobal.
- The HTTP X FORWARDED FOR header
- The request method (i.e. GET, POST, e.t.c.)
- The actual log message