I have 2 static initializers trying to call each other:
- one in a Configuration class, that reads configuration parameters from a properties file;
- one in a LoggerFactory class, which sets up the default logging parameters.
The problem is they reference each other:
- the Configuration class needs the logger to log potential I/O issues when reading the properties file.
- the LoggerFactory needs the Configuration file to setup the log file name, log patterns and default log level.
This is obviously not right and I get some NPE here and there.
Is there a standard way of dealing with that kind of situation?