Articles on: Maintenance

How to enable logging

When assisting you, Support staff may ask you to provide log files to troubleshoot a problem. Here's how you can create such logs:

In config.php, edit the following lines:

define('LOG_LEVEL', 4);
define('LOG_TEXTFILE', '/home/user/logs/ce.log');

In our example we use 4 as the logging level, but you can put any number between 0 and 5, which have the following meanings:

No logging

Security attacks attempts, errors and important messages (recommended level)

Reserved for debugging (only logs if DEBUG is true in config.php)

Warnings and EventLogs, VIEW/ACTION and Request URIs and URI redirections and POST/COOKIE values

plugin events, curl requests, some function calls with their parameters, etc.

include suppressed actions and SMTP traffic.

Action responses (ajax,serialized,XML (as array)

Remember to put quotes around the file you specified next to LOG_TEXTFILE. You must create this file and give it writing permissions to the user under which your webserver runs. Also, don't put this file under the webserver documents root directory, as it will contain passwords and other sensitive information.

If you're trying to generate a log to send to support to help them diagnose problem, enable logging just before reproducing the problem, and then disable it just after having reproduced the problem, so the log will only show what support needs to know.

Please use log level 4 when submitting a log to staff. If you are sending a log about SMTP not working, please use log level 5 instead.

Note:

When support no longer needs access to your log file remember to re-edit your config.php file and change the lines back to:

define('LOG_LEVEL', 1);
define('LOG_TEXTFILE', false);

and then you can also delete the log file.

Updated on: 29/05/2024

Was this article helpful?

Share your feedback

Cancel

Thank you!