// log an error message to the system log $errorMsg = 'An error occurred while processing the request'; GeneralUtility::sysLog($errorMsg, 'example_extension', GeneralUtility::SYSLOG_SEVERITY_ERROR);
// log a debug message to the system log $debugMsg = 'The value of the variable is: ' . $variable; GeneralUtility::sysLog($debugMsg, 'example_extension', GeneralUtility::SYSLOG_SEVERITY_DEBUG);In this example, we log a debug message using the sysLog method. The message includes the value of a variable, making it easier to debug issues. We use the SYSLOG_SEVERITY_DEBUG constant to indicate that this is a debug message. The GeneralUtility class and its sysLog method are part of the TYPO3 CMS core library.