Detecting Improper Shutdown in Linux [kernel panic] [improper shutdown]

Q: I was wondering if there was a way to detect improper shutdown on linux .
I want to print the / var / log / messages kernel oops or kernel panic or improper shutdown will help occurs.

any appreciated.
thanks