mirror of
https://github.com/brmlab/wekan-mailer.git
synced 2025-06-09 02:14:04 +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
|
@ -22,6 +22,7 @@ public class Application implements CommandLineRunner {
|
||||||
public void run(String... args) {
|
public void run(String... args) {
|
||||||
try {
|
try {
|
||||||
WekanConfiguration wekanConfiguration = new WekanConfiguration();
|
WekanConfiguration wekanConfiguration = new WekanConfiguration();
|
||||||
|
|
||||||
} catch (BrmException ex) {
|
} catch (BrmException ex) {
|
||||||
System.exit(ex.getExitCode().getCode());
|
System.exit(ex.getExitCode().getCode());
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,8 @@ public class WekanConfiguration {
|
||||||
* @throws BrmException if some of the properties is missing in ENV variables.
|
* @throws BrmException if some of the properties is missing in ENV variables.
|
||||||
*/
|
*/
|
||||||
public WekanConfiguration() throws BrmException {
|
public WekanConfiguration() throws BrmException {
|
||||||
|
LOG.trace("{}() - start.", this.getClass().getSimpleName());
|
||||||
|
|
||||||
for (String prop : properties) {
|
for (String prop : properties) {
|
||||||
checkProp(prop);
|
checkProp(prop);
|
||||||
}
|
}
|
||||||
|
@ -41,6 +43,8 @@ public class WekanConfiguration {
|
||||||
this.wekanPassword = System.getenv(WEKAN_PASSWORD);
|
this.wekanPassword = System.getenv(WEKAN_PASSWORD);
|
||||||
this.wekanBoard = System.getenv(WEKAN_TARGET_BOARD);
|
this.wekanBoard = System.getenv(WEKAN_TARGET_BOARD);
|
||||||
this.wekanList = System.getenv(WEKAN_TARGET_LIST);
|
this.wekanList = System.getenv(WEKAN_TARGET_LIST);
|
||||||
|
|
||||||
|
LOG.info("Wekan config loaded successfully.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
|
@ -59,6 +63,8 @@ public class WekanConfiguration {
|
||||||
private String wekanList;
|
private String wekanList;
|
||||||
|
|
||||||
private void checkProp(String prop) throws BrmException {
|
private void checkProp(String prop) throws BrmException {
|
||||||
|
LOG.trace("checkProp({}) - start.", prop);
|
||||||
|
|
||||||
if (System.getenv(prop) == null) {
|
if (System.getenv(prop) == null) {
|
||||||
String message = ExitCode.CONFIGURATION_MISSING.getReason() + prop;
|
String message = ExitCode.CONFIGURATION_MISSING.getReason() + prop;
|
||||||
LOG.error(message, ExitCode.CONFIGURATION_MISSING);
|
LOG.error(message, ExitCode.CONFIGURATION_MISSING);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue