mirror of
https://github.com/brmlab/wekan-mailer.git
synced 2025-06-08 09:54:10 +02:00
Add bit more logging to WekanConfig
This commit is contained in:
parent
b1f005dd19
commit
4546d9099c
2 changed files with 8 additions and 1 deletions
|
@ -19,9 +19,10 @@ public class Application implements CommandLineRunner {
|
|||
|
||||
|
||||
@Override
|
||||
public void run(String... args) {
|
||||
public void run(String... args) {
|
||||
try {
|
||||
WekanConfiguration wekanConfiguration = new WekanConfiguration();
|
||||
|
||||
} catch (BrmException ex) {
|
||||
System.exit(ex.getExitCode().getCode());
|
||||
}
|
||||
|
|
|
@ -33,6 +33,8 @@ public class WekanConfiguration {
|
|||
* @throws BrmException if some of the properties is missing in ENV variables.
|
||||
*/
|
||||
public WekanConfiguration() throws BrmException {
|
||||
LOG.trace("{}() - start.", this.getClass().getSimpleName());
|
||||
|
||||
for (String prop : properties) {
|
||||
checkProp(prop);
|
||||
}
|
||||
|
@ -41,6 +43,8 @@ public class WekanConfiguration {
|
|||
this.wekanPassword = System.getenv(WEKAN_PASSWORD);
|
||||
this.wekanBoard = System.getenv(WEKAN_TARGET_BOARD);
|
||||
this.wekanList = System.getenv(WEKAN_TARGET_LIST);
|
||||
|
||||
LOG.info("Wekan config loaded successfully.");
|
||||
}
|
||||
|
||||
@Getter
|
||||
|
@ -59,6 +63,8 @@ public class WekanConfiguration {
|
|||
private String wekanList;
|
||||
|
||||
private void checkProp(String prop) throws BrmException {
|
||||
LOG.trace("checkProp({}) - start.", prop);
|
||||
|
||||
if (System.getenv(prop) == null) {
|
||||
String message = ExitCode.CONFIGURATION_MISSING.getReason() + prop;
|
||||
LOG.error(message, ExitCode.CONFIGURATION_MISSING);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue