mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Update error-handling.md
Add how to log notices (deprecation notifications can help with discovering problems caused by old code).
This commit is contained in:
parent
3b3478136d
commit
6c6d217273
@ -58,9 +58,11 @@ added.
|
|||||||
|
|
||||||
:::php
|
:::php
|
||||||
// log errors and warnings
|
// log errors and warnings
|
||||||
SS_Log::add_writer(new SS_LogFileWriter('/my/logfile/path'), SS_Log::WARN, '<=');
|
SS_Log::add_writer(new SS_LogFileWriter('../silverstripe-errors-warnings.log'), SS_Log::WARN, '<=');
|
||||||
// or just errors
|
// or just errors
|
||||||
SS_Log::add_writer(new SS_LogFileWriter('/my/logfile/path'), SS_Log::ERR);
|
SS_Log::add_writer(new SS_LogFileWriter('../silverstripe-errors.log'), SS_Log::ERR);
|
||||||
|
// or notices (e.g. for Deprecation Notifications)
|
||||||
|
SS_Log::add_writer(new SS_LogFileWriter('../silverstripe-errors-notices.log'), SS_Log::NOTICE);
|
||||||
|
|
||||||
### From PHP
|
### From PHP
|
||||||
|
|
||||||
@ -84,4 +86,4 @@ You can send both fatal errors and warnings in your code to a specified email-ad
|
|||||||
// log errors and warnings
|
// log errors and warnings
|
||||||
SS_Log::add_writer(new SS_LogEmailWriter('admin@domain.com'), SS_Log::WARN, '<=');
|
SS_Log::add_writer(new SS_LogEmailWriter('admin@domain.com'), SS_Log::WARN, '<=');
|
||||||
// or just errors
|
// or just errors
|
||||||
SS_Log::add_writer(new SS_LogEmailWriter('admin@domain.com'), SS_Log::ERR);
|
SS_Log::add_writer(new SS_LogEmailWriter('admin@domain.com'), SS_Log::ERR);
|
||||||
|
Loading…
Reference in New Issue
Block a user