Feature: Web Panic Reporting via hooks

This PR is for issue of "email after registry webapp panic" #41, improving my
previous design (closed).
It use self setting up hooks, to catch panic in web application.
And, send email in hooks handle directly, to no use new http server and
handler.

Signed-off-by: xiekeyang <keyangxie@126.com>
This commit is contained in:
xiekeyang 2015-04-17 20:19:20 +08:00 committed by xiekeyang
parent 1f015478a0
commit 47aa47e3f6
7 changed files with 223 additions and 2 deletions

View file

@ -20,6 +20,7 @@ var configStruct = Configuration{
Level Loglevel `yaml:"level"`
Formatter string `yaml:"formatter,omitempty"`
Fields map[string]interface{} `yaml:"fields,omitempty"`
Hooks []LogHook `yaml:"hooks,omitempty"`
}{
Fields: map[string]interface{}{"environment": "test"},
},