File tree Expand file tree Collapse file tree 3 files changed +81
-0
lines changed
samples/example-spring-boot-app
src/main/java/com/exceptionless/example/spring/boot/app Expand file tree Collapse file tree 3 files changed +81
-0
lines changed Original file line number Diff line number Diff line change 8
8
<artifactId >example-spring-boot-app</artifactId >
9
9
<version >1.0-SNAPSHOT</version >
10
10
11
+ <parent >
12
+ <groupId >org.springframework.boot</groupId >
13
+ <artifactId >spring-boot-starter-parent</artifactId >
14
+ <version >2.3.4.RELEASE</version >
15
+ </parent >
11
16
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 >
12
47
</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