I'm doing a small program which needs to read error meesage when errors occur.

For example, one operation triggered an error, and php log recorded it as:

```
PHP Fatal error:  Smarty error: [in /mnt/n2my_web/templates/ja_JP/mail/reservation_create.t.txt line 16]: syntax error: mismatched tag {/if}. (Smarty_Compiler.class.php, line 2338) in /mnt/n2my_web/lib/Smarty/Smarty.class.php on line 1092

```

I know by setting **ini\_set('display\_errors', '1');** the error message can be printed. But I need to read it, in order to format it.

By which means can I achieve this? Any answer is appreciated. :)