Errorhandeling the Stack

If I write an Error handler. Is it possible in code to look at the stack, so I can write it down in a log file?
[111 byte] By [stickan] at [2007-11-18 2:14:25]