@@ -229,7 +229,9 @@ public synchronized void run(final String[] args, final Observer observer) {
229
229
addObserver (observer );
230
230
}
231
231
232
- logger .info ("Running with Java {} [{} ({}) in {}]" ,
232
+ logger .info ("Operating System: {} {} {}]" , System .getProperty ("os.name" ), System .getProperty ("os.version" ), System .getProperty ("os.arch" ));
233
+ logger .info ("Running as user: {}" , System .getProperty ("user.name" , "(unknown user.name)" ));
234
+ logger .info ("Using Java: {} [{} ({}) in {}]" ,
233
235
System .getProperty ("java.version" , "(unknown java.version)" ),
234
236
System .getProperty ("java.vendor" , "(unknown java.vendor)" ),
235
237
System .getProperty ("java.vm.name" , "(unknown java.vm.name)" ),
@@ -239,19 +241,11 @@ public synchronized void run(final String[] args, final Observer observer) {
239
241
logger .info ("Approximate maximum amount of memory for JVM: {}" , FileUtils .humanSize (Runtime .getRuntime ().maxMemory ()));
240
242
logger .info ("Number of processors available to JVM: {}" , Runtime .getRuntime ().availableProcessors ());
241
243
242
- logger .info ("Running as user '{}'" , System .getProperty ("user.name" , "(unknown user.name)" ));
243
- logger .info ("[Elemental Home : {}]" , System .getProperty ("exist.home" , "unknown" ));
244
- logger .info ("[Elemental Version : {}]" , SystemProperties .getInstance ().getSystemProperty ("product-version" , "unknown" ));
245
- logger .info ("[Elemental Build : {}]" , SystemProperties .getInstance ().getSystemProperty ("product-build" , "unknown" ));
246
- logger .info ("[Git commit : {}]" , SystemProperties .getInstance ().getSystemProperty ("git-commit" , "unknown" ));
247
- logger .info ("[Git commit timestamp : {}]" , SystemProperties .getInstance ().getSystemProperty ("git-commit-timestamp" , "unknown" ));
248
-
249
- logger .info ("[Operating System : {} {} {}]" , System .getProperty ("os.name" ), System .getProperty ("os.version" ), System .getProperty ("os.arch" ));
250
- logger .info ("[log4j.configurationFile : {}]" , System .getProperty ("log4j.configurationFile" ));
251
- logger .info ("[jetty Version: {}]" , Jetty .VERSION );
252
- logger .info ("[{} : {}]" , JETTY_HOME_PROP , configProperties .get (JETTY_HOME_PROP ));
253
- logger .info ("[{} : {}]" , JETTY_BASE_PROP , configProperties .get (JETTY_BASE_PROP ));
254
- logger .info ("[jetty configuration : {}]" , jettyConfig .toAbsolutePath ().toString ());
244
+ logger .info ("[Elemental Version: {}]" , SystemProperties .getInstance ().getSystemProperty ("product-version" , "unknown" ));
245
+ logger .info ("[Elemental Build: {}]" , SystemProperties .getInstance ().getSystemProperty ("product-build" , "unknown" ));
246
+ logger .info ("[Elemental Git commit: {}]" , SystemProperties .getInstance ().getSystemProperty ("git-commit" , "unknown" ));
247
+ logger .info ("[Elemental Git commit timestamp: {}]" , SystemProperties .getInstance ().getSystemProperty ("git-commit-timestamp" , "unknown" ));
248
+ logger .info ("[Elemental Home: {}]" , System .getProperty ("exist.home" , "unknown" ));
255
249
256
250
// configure the database instance
257
251
SingleInstanceConfiguration config ;
@@ -260,10 +254,16 @@ public synchronized void run(final String[] args, final Observer observer) {
260
254
} else {
261
255
config = new SingleInstanceConfiguration ();
262
256
}
263
- logger .info ("Configuring Elemental from {}" ,
264
- config .getConfigFilePath ()
265
- .map (Path ::normalize ).map (Path ::toAbsolutePath ).map (Path ::toString )
266
- .orElse ("<UNKNOWN>" ));
257
+ final String elementalConfigPath = config .getConfigFilePath ()
258
+ .map (Path ::normalize ).map (Path ::toAbsolutePath ).map (Path ::toString )
259
+ .orElse ("<UNKNOWN>" );
260
+ logger .info ("[Elemental Configuration: {}]" , elementalConfigPath );
261
+
262
+ logger .info ("[Log4j Configuration: {}]" , System .getProperty ("log4j.configurationFile" ));
263
+ logger .info ("[Jetty Version: {}]" , Jetty .VERSION );
264
+ logger .info ("[Jetty Home: {}]" , configProperties .get (JETTY_HOME_PROP ));
265
+ logger .info ("[Jetty Base: {}]" , configProperties .get (JETTY_BASE_PROP ));
266
+ logger .info ("[Jetty Configuration: {}]" , jettyConfig .toAbsolutePath ().toString ());
267
267
268
268
BrokerPool .configure (1 , 5 , config , Optional .ofNullable (observer ));
269
269
@@ -284,7 +284,9 @@ public synchronized void run(final String[] args, final Observer observer) {
284
284
final List <Object > configuredObjects = new ArrayList <>();
285
285
XmlConfiguration last = null ;
286
286
for (final Path confFile : configFiles ) {
287
- logger .info ("[loading jetty configuration : {}]" , confFile .toString ());
287
+ if (logger .isDebugEnabled ()) {
288
+ logger .debug ("[Loading Jetty Configuration: {}]" , confFile .toString ());
289
+ }
288
290
final Resource resource = new PathResource (confFile );
289
291
final XmlConfiguration configuration = new XmlConfiguration (resource );
290
292
if (last != null ) {
@@ -508,7 +510,9 @@ private Optional<Server> startJetty(final List<Object> configuredObjects) throws
508
510
509
511
try {
510
512
Runtime .getRuntime ().addShutdownHook (shutdownHookThread );
511
- logger .debug ("BrokerPoolsAndJetty.ShutdownHook hook registered" );
513
+ if (logger .isDebugEnabled ()) {
514
+ logger .debug ("BrokerPoolsAndJetty.ShutdownHook hook registered" );
515
+ }
512
516
} catch (final IllegalArgumentException | IllegalStateException e ) {
513
517
// Hook already registered, or Shutdown in progress
514
518
logger .error ("Unable to add BrokerPoolsAndJetty.ShutdownHook hook: {}" , e .getMessage (), e );
@@ -520,7 +524,9 @@ private Optional<Server> startJetty(final List<Object> configuredObjects) throws
520
524
521
525
if (configuredObject instanceof LifeCycle lc ) {
522
526
if (!lc .isRunning ()) {
523
- logger .info ("[Starting jetty component : {}]" , lc .getClass ().getName ());
527
+ if (logger .isDebugEnabled ()) {
528
+ logger .debug ("[Starting Jetty Component : {}]" , lc .getClass ().getName ());
529
+ }
524
530
lc .start ();
525
531
}
526
532
}
@@ -582,7 +588,9 @@ public synchronized void shutdown() {
582
588
shutdownHookThread .ifPresent (thread -> {
583
589
try {
584
590
Runtime .getRuntime ().removeShutdownHook (thread );
585
- logger .debug ("BrokerPoolsAndJetty.ShutdownHook hook unregistered" );
591
+ if (logger .isDebugEnabled ()) {
592
+ logger .debug ("BrokerPoolsAndJetty.ShutdownHook hook unregistered" );
593
+ }
586
594
} catch (final IllegalStateException e ) {
587
595
// Shutdown in progress
588
596
logger .warn ("Unable to remove BrokerPoolsAndJetty.ShutdownHook hook: {}" , e .getMessage ());
@@ -677,7 +685,9 @@ public synchronized boolean isStarted() {
677
685
678
686
@ Override
679
687
public synchronized void lifeCycleStarting (final LifeCycle lifeCycle ) {
680
- logger .info ("Jetty server starting..." );
688
+ if (logger .isDebugEnabled ()) {
689
+ logger .debug ("Jetty server starting..." );
690
+ }
681
691
setChanged ();
682
692
notifyObservers (SIGNAL_STARTING );
683
693
status = STATUS_STARTING ;
@@ -686,7 +696,9 @@ public synchronized void lifeCycleStarting(final LifeCycle lifeCycle) {
686
696
687
697
@ Override
688
698
public synchronized void lifeCycleStarted (final LifeCycle lifeCycle ) {
689
- logger .info ("Jetty server started." );
699
+ if (logger .isDebugEnabled ()) {
700
+ logger .debug ("Jetty server started." );
701
+ }
690
702
setChanged ();
691
703
notifyObservers (SIGNAL_STARTED );
692
704
status = STATUS_STARTED ;
@@ -699,14 +711,18 @@ public void lifeCycleFailure(final LifeCycle lifeCycle, final Throwable throwabl
699
711
700
712
@ Override
701
713
public synchronized void lifeCycleStopping (final LifeCycle lifeCycle ) {
702
- logger .info ("Jetty server stopping..." );
714
+ if (logger .isDebugEnabled ()) {
715
+ logger .debug ("Jetty server stopping..." );
716
+ }
703
717
status = STATUS_STOPPING ;
704
718
notifyAll ();
705
719
}
706
720
707
721
@ Override
708
722
public synchronized void lifeCycleStopped (final LifeCycle lifeCycle ) {
709
- logger .info ("Jetty server stopped" );
723
+ if (logger .isDebugEnabled ()) {
724
+ logger .debug ("Jetty server stopped" );
725
+ }
710
726
status = STATUS_STOPPED ;
711
727
notifyAll ();
712
728
}
0 commit comments