- Notifications
You must be signed in to change notification settings - Fork439
Feature/logging Adding logging functionality to the application#17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Open
harshil15999 wants to merge7 commits intocallicoder:masterChoose a base branch fromharshil15999:feature/logging
base:master
Could not load branches
Branch not found:{{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline, and old review comments may become outdated.
Uh oh!
There was an error while loading.Please reload this page.
Open
Changes fromall commits
Commits
Show all changes
7 commits Select commitHold shift + click to select a range
92dd793
Feat: Adding dependencies to use slf4j2 logging
harshil15999a4f4f80
Feature: Adding logging in IndexController routes
harshil15999d56ae05
Feature: Adding logging parameters in properties file
harshil15999fc5ec25
Feature: Post controller to upload a file
harshil1599991bd0be
Feature: Adding all messages for response
harshil1599922ab355
Feature: Creating a bean for Messages Class
harshil159997f136cc
Feature: Adding files which are downloaded through POST
harshil15999File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
38 changes: 30 additions & 8 deletionspom.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
15 changes: 12 additions & 3 deletionssrc/main/java/com/example/easynotes/controller/IndexController.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,25 @@ | ||
package com.example.easynotes.controller; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
@RestController | ||
@RequestMapping("/") | ||
@Slf4j | ||
public class IndexController { | ||
@GetMapping | ||
public String sayHello() { | ||
try{ | ||
log.info("/ API hit"); | ||
return "Hello and Welcome to the EasyNotes application. You can create a new Note by making a POST request to /api/notes endpoint."; | ||
} catch (Exception e ){ | ||
log.error("Error:{}",e); | ||
return "Contact Administrator"; | ||
} | ||
} | ||
} |
62 changes: 62 additions & 0 deletionssrc/main/java/com/example/easynotes/controller/NoteController.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletionssrc/main/java/com/example/easynotes/exception/Messages.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.example.easynotes.exception; | ||
import org.springframework.stereotype.Component; | ||
@Component | ||
public class Messages { | ||
public final String FileNotFound="File Not Found"; | ||
public final String InvalidFileName="Invalid FileName"; | ||
public final String SuccessFullyUploaded="File uploaded successfully"; | ||
public final String ErrorSavingFile ="Error saving the file"; | ||
public final String FileLimit=" File must be not empty and less than 2Gb"; | ||
} |
20 changes: 20 additions & 0 deletionssrc/main/java/config/AppConfig.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package config; | ||
import com.example.easynotes.exception.Messages; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.ComponentScan; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.http.ResponseEntity; | ||
@ComponentScan | ||
@Configuration | ||
public class AppConfig { | ||
private String messages; | ||
private HttpStatus status; | ||
@Bean | ||
public Messages messages(){ | ||
return new Messages(); | ||
} | ||
} |
14 changes: 13 additions & 1 deletionsrc/main/resources/application.properties
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Binary file addedsrc/main/resources/notes/2023-01-05 (1).png
Loading
Sorry, something went wrong.Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file addedsrc/main/resources/notes/SortServer2008Compat.nls
Binary file not shown.
Binary file addedsrc/main/resources/notes/SortWindows62.nls
Binary file not shown.
1 change: 1 addition & 0 deletionssrc/main/resources/notes/thoughts.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
you need to experience the bad to enjoy the good and the good to identify the bad |
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.