@@ -76,17 +76,23 @@ public class BlockNodeApp implements HealthFacility {
76
76
BlockNodeApp (final ServiceLoaderFunction serviceLoader , final boolean shouldExitJvmOnShutdown ) throws IOException {
77
77
this .shouldExitJvmOnShutdown = shouldExitJvmOnShutdown ;
78
78
// ==== LOAD LOGGING CONFIG ====================================================================================
79
- // load the logging configuration from the classpath and make it colorful
80
- try (var loggingConfigIn = BlockNodeApp .class .getClassLoader ().getResourceAsStream ("logging.properties" )) {
81
- if (loggingConfigIn != null ) {
82
- LogManager .getLogManager ().readConfiguration (loggingConfigIn );
83
- } else {
84
- LOGGER .log (INFO , "No logging configuration found" );
79
+ final boolean externalLogging = System .getProperty ("java.util.logging.config.file" ) != null ;
80
+ if (externalLogging ) {
81
+ LOGGER .log (INFO , "External logging configuration found" );
82
+ } else {
83
+ // load the logging configuration from the classpath and make it colorful
84
+ try (var loggingConfigIn = BlockNodeApp .class .getClassLoader ().getResourceAsStream ("logging.properties" )) {
85
+ if (loggingConfigIn != null ) {
86
+ LogManager .getLogManager ().readConfiguration (loggingConfigIn );
87
+ } else {
88
+ LOGGER .log (INFO , "No logging configuration found" );
89
+ }
90
+ } catch (IOException e ) {
91
+ LOGGER .log (INFO , "Failed to load logging configuration" , e );
85
92
}
86
- } catch ( IOException e ) {
87
- LOGGER .log (INFO , "Failed to load logging configuration" , e );
93
+ CleanColorfulFormatter . makeLoggingColorful ();
94
+ LOGGER .log (INFO , "Using default logging configuration" );
88
95
}
89
- CleanColorfulFormatter .makeLoggingColorful ();
90
96
// tell helidon to use the same logging configuration
91
97
System .setProperty ("io.helidon.logging.config.disabled" , "true" );
92
98
// ==== LOG HIERO MODULES ======================================================================================
0 commit comments