That completely depends on your server configuration and is independent of MODX entirely.
Common locations are within a server control panel, /usr/local/apache/logs/error_log, var/log/httpd/error_log, /var/log/apache2/error.log, as error_log files in the directory the error was triggered in, or elsewhere. On MODX Cloud it’s in your home directory > log.
If you check the phpinfo() output (which MODX has a utility for, in manage > reports > system info > phpinfo()) find the error_log directive. That normally points to the location for the error log. However if that’s empty, it may not write logs anywhere and you’ll need to edit the php.ini or ask you host.
Finally if there’s no way to track it down, adding these two lines in your php file may allow the error message to be shown on screen instead:
<?php
@ini_set('display_errors');
error_reporting(E_ALL);
Again this is not related to MODX but basic debugging of any php application. Google information specific to how your server is setup if you still can’t find it with this.