-
Notifications
You must be signed in to change notification settings - Fork 0
Read logging configuration file from snippets #301
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feat/V2.0-next
Are you sure you want to change the base?
Read logging configuration file from snippets #301
Conversation
Dependency Review✅ No vulnerabilities or license issues found.Scanned Manifest Files |
| return get("SINCH_PHONE_NUMBER"); | ||
| } | ||
|
|
||
| public static void initializeLogger() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be made private
| LOGGER.config( | ||
| String.format( | ||
| "Error reading '%s' configuration file: %s", LOGGING_CONFIG_FILE, ioe.getMessage())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are using the logger to log an error about the logger that may have not been initialized. Is it ok to do that, or the error message will be invisible?
| try { | ||
| // load a properties file from class path, inside static method | ||
| properties.load(Settings.class.getClassLoader().getResourceAsStream("config.properties")); | ||
| properties.load(Settings.class.getClassLoader().getResourceAsStream(CONFIG_FILE)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: instead of throwing a NPE when the file is not found, you may check if the inputStream is not null before loading the properties and log that the config file is not found if null
No description provided.