They are logged as WARNING level in \DeprecatedCallsLog::ENUM_CHANNEL_PHP_LIBMETHOD channel
Such deprecated notices are generated inside Symfony for example using @trigger_error(..., E_DEPRECATED).
Having such a log will help us migrate to the next lib version !
Such notices are generated inside Symfony for example using @trigger_error(..., E_DEPRECATED).
Having such a log will help us migrate to the next version !
This was bringed by #193
The stack trace wasn't used correctly :/ This is now fixed !
Sample message for deprecated PHP method call :
`2021-04-13 15:31:47 | Warning | Call to WebPage:outputCollapsibleSectionInit in C:\...\itop-dev\sources\application\WebPage\AjaxPage.php#L170 (AjaxPage::output) | deprecated-php-method`
Log message for deprecated PHP file remains the same :
`2021-04-13 10:31:12 | Warning | C:\...\itop-dev\sources\application\WebPage\WebPage.php L32 including/requiring C:\...\itop-dev\core\coreexception.class.inc.php : Classes were moved to /application/exceptions | deprecated-file`
* New DeprecatedCallsLog logger enabled directly in bootstrap so that we can use it in the most situations
* Default Log level is now DEBUG for dev env, ERROR for others
* Logs the caller and the deprecated method called, like :
`2021-04-06 10:52:25 | Warning | AjaxPage::output L2857 calling WebPage:outputCollapsibleSectionInit | deprecated-method`
* Sample file consumer
* Sample php consumer
First log implementation (75730ee) was creating EventIssue objects, and was rollbacking transaction if it exists
The new one has some benefits :
* always log one line by default in log/error.log, but details must be activated though config (channels `Deadlock-WaitTimeout` and `Deadlock-Found`)
* detailed logs are in a dedicated file (log/deadlock.log) :
- easier for our clients to get and share
- has rotation by default
- looking at the file size is a direct way to know if error happened
- more compliant to industry standards !
* the transaction stays untouched, so that the consumer can do whatever it prefers
Now log file name is unchanged : current log is still /log/error.log \o/
Rotation check (using file last modification time) is done :
* on each file write : we don't want to miss calls if session last from 23:59:59 to 00:01 for example ! Though the filemtime() call is done once per session to lower performance impacts
* using a new background process (LogFileRotationProcess)
File renaming on setup is therefore removed.
Also the interface is renamed (from ILogFileNameBuilder to iLogFileNameBuilder) to conform to iTop convention.