File tree Expand file tree Collapse file tree
example-app/src/main/java/com/exceptionless/example/app
src/main/java/com/exceptionless/example/spring/boot/app Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- package com .exceptionless .sample .app ;
1+ package com .exceptionless .example .app ;
22
33import com .exceptionless .exceptionlessclient .ExceptionlessClient ;
44import com .exceptionless .exceptionlessclient .models .EventPluginContext ;
55
6- public class Main {
6+ public class ExampleApp {
77 private static final ExceptionlessClient client =
88 ExceptionlessClient .from (
99 System .getenv ("EXCEPTIONLESS_SAMPLE_APP_API_KEY" ),
Original file line number Diff line number Diff line change 88 <artifactId >example-spring-boot-app</artifactId >
99 <version >1.0-SNAPSHOT</version >
1010
11+ <parent >
12+ <groupId >org.springframework.boot</groupId >
13+ <artifactId >spring-boot-starter-parent</artifactId >
14+ <version >2.3.4.RELEASE</version >
15+ </parent >
1116
17+ <dependencies >
18+ <dependency >
19+ <groupId >com.exceptionless</groupId >
20+ <artifactId >exceptionless-client</artifactId >
21+ <version >1.0-beta1</version >
22+ </dependency >
23+ <dependency >
24+ <groupId >org.springframework.boot</groupId >
25+ <artifactId >spring-boot-starter-web</artifactId >
26+ </dependency >
27+ <dependency >
28+ <groupId >com.squareup.okhttp3</groupId >
29+ <artifactId >okhttp</artifactId >
30+ <version >4.9.1</version >
31+ </dependency >
32+ </dependencies >
33+
34+ <build >
35+ <plugins >
36+ <plugin >
37+ <groupId >org.apache.maven.plugins</groupId >
38+ <artifactId >maven-compiler-plugin</artifactId >
39+ <version >3.5.1</version >
40+ <configuration >
41+ <source >11</source >
42+ <target >11</target >
43+ </configuration >
44+ </plugin >
45+ </plugins >
46+ </build >
1247</project >
Original file line number Diff line number Diff line change 1+ package com .exceptionless .example .spring .boot .app ;
2+
3+ import com .exceptionless .exceptionlessclient .ExceptionlessClient ;
4+ import org .springframework .boot .SpringApplication ;
5+ import org .springframework .boot .autoconfigure .SpringBootApplication ;
6+ import org .springframework .context .annotation .Bean ;
7+
8+ @ SpringBootApplication
9+ public class ExampleAPI {
10+ public static void main (String [] args ) {
11+ SpringApplication .run (ExampleAPI .class , args );
12+ }
13+
14+ @ Bean
15+ public ExceptionlessClient exceptionlessClient () {
16+ return ExceptionlessClient .from (
17+ System .getenv ("EXCEPTIONLESS_SAMPLE_APP_API_KEY" ),
18+ System .getenv ("EXCEPTIONLESS_SAMPLE_APP_SERVER_URL" ));
19+ }
20+ }
Original file line number Diff line number Diff line change 1+ package com .exceptionless .example .spring .boot .app .api ;
2+
3+ import com .exceptionless .exceptionlessclient .ExceptionlessClient ;
4+ import org .springframework .beans .factory .annotation .Autowired ;
5+ import org .springframework .http .HttpStatus ;
6+ import org .springframework .web .bind .annotation .PostMapping ;
7+ import org .springframework .web .bind .annotation .RequestMapping ;
8+ import org .springframework .web .bind .annotation .ResponseStatus ;
9+ import org .springframework .web .bind .annotation .RestController ;
10+
11+ @ RestController
12+ @ RequestMapping ("/test" )
13+ public class ExampleResource {
14+ private final ExceptionlessClient exceptionlessClient ;
15+
16+ @ Autowired
17+ public ExampleResource (ExceptionlessClient exceptionlessClient ) {
18+ this .exceptionlessClient = exceptionlessClient ;
19+ }
20+
21+ @ PostMapping ("/log" )
22+ @ ResponseStatus (HttpStatus .ACCEPTED )
23+ public void submitLog () {
24+ exceptionlessClient .submitLog ("test-log" );
25+ }
26+ }
You can’t perform that action at this time.
0 commit comments