File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
src/main/java/com/example/demo Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 44import org .springframework .boot .autoconfigure .SpringBootApplication ;
55import org .springframework .web .bind .annotation .GetMapping ;
66import org .springframework .web .bind .annotation .RestController ;
7+ import org .slf4j .Logger ;
8+ import org .slf4j .LoggerFactory ;
9+
710
811@ SpringBootApplication
912@ RestController
1013public class DemoApplication {
11-
14+ Logger logger = LoggerFactory . getLogger ( DemoApplication . class );
1215 @ GetMapping ("/" )
1316 public String home () {
1417 return "Hello World!" ;
@@ -23,7 +26,8 @@ public String home22() {
2326 }
2427 catch (Exception ex )
2528 {
26- ex .printStackTrace (); //this will get "Some required files are missing"
29+ logger .error ("An exception occurred!" , ex );
30+ //ex.printStackTrace(); //this will get "Some required files are missing"
2731 }
2832 return "hello error" ;
2933
You can’t perform that action at this time.
0 commit comments