In pgwatch2, we monitor server log events like ERROR, FATAL and count their occurences.
This is far too generic and i doubt the usefulness of this information at (e.g. ERROR can be just
a mistyped query or the like).
Instead, i suggest to count the server log events according their SQLSTATE classes. The first
two bytes of an SQLSTATE identifier describes the message class a specific message belongs to (e.g. 53 for insufficient resources). This way we can distuingish specific error conditions and expose them in a more meaningful context.