Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGlobal.java
More file actions
Latest commit
46 lines (34 loc) · 1.14 KB
/
Copy pathGlobal.java
File metadata and controls
46 lines (34 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
importcom.errplane.api.Errplane;
importcom.errplane.examples.standalone.ErrplaneFlusher;
importplay.Application;
importplay.GlobalSettings;
publicclassGlobalextendsGlobalSettings {
privateErrplaneFlusherflusher;
@Override
publicvoidonStart(Applicationapp) {
// try to initialize Errplane
if (!initErrplane()) {
System.out.println("Errplane initialization failed!");
System.out.println("Make sure you have set the environment variables: EP_APP, EP_API, and EP_ENV!");
return;
}
// fire up the flusher
flusher = newErrplaneFlusher();
flusher.startFlusher();
// fire up the heartbeat at the default 30 second interval
flusher.heartbeat("errplane-java/playApplicationHB");
Errplane.report("errplane-java/playApplicationStartup");
}
@Override
publicvoidonStop(Applicationapp) {
Errplane.report("errplane-java/playApplicationShutdown");
// clear Errplane reports
flusher.stopFlusher();
}
privatestaticbooleaninitErrplane() {
StringappKey = System.getenv("EP_APP");
StringapiKey = System.getenv("EP_API");
Stringenv = System.getenv("EP_ENV");
returnErrplane.init(appKey, apiKey, env);
}
}