@@ -202,7 +202,9 @@ public synchronized void run(final String[] args, final Observer observer) {
202202 addObserver (observer );
203203 }
204204
205- logger .info ("Running with Java {} [{} ({}) in {}]" ,
205+ logger .info ("Operating System: {} {} {}]" , System .getProperty ("os.name" ), System .getProperty ("os.version" ), System .getProperty ("os.arch" ));
206+ logger .info ("Running as user: {}" , System .getProperty ("user.name" , "(unknown user.name)" ));
207+ logger .info ("Using Java: {} [{} ({}) in {}]" ,
206208 System .getProperty ("java.version" , "(unknown java.version)" ),
207209 System .getProperty ("java.vendor" , "(unknown java.vendor)" ),
208210 System .getProperty ("java.vm.name" , "(unknown java.vm.name)" ),
@@ -212,19 +214,11 @@ public synchronized void run(final String[] args, final Observer observer) {
212214 logger .info ("Approximate maximum amount of memory for JVM: {}" , FileUtils .humanSize (Runtime .getRuntime ().maxMemory ()));
213215 logger .info ("Number of processors available to JVM: {}" , Runtime .getRuntime ().availableProcessors ());
214216
215- logger .info ("Running as user '{}'" , System .getProperty ("user.name" , "(unknown user.name)" ));
216- logger .info ("[Elemental Home : {}]" , System .getProperty ("exist.home" , "unknown" ));
217- logger .info ("[Elemental Version : {}]" , SystemProperties .getInstance ().getSystemProperty ("product-version" , "unknown" ));
218- logger .info ("[Elemental Build : {}]" , SystemProperties .getInstance ().getSystemProperty ("product-build" , "unknown" ));
219- logger .info ("[Git commit : {}]" , SystemProperties .getInstance ().getSystemProperty ("git-commit" , "unknown" ));
220- logger .info ("[Git commit timestamp : {}]" , SystemProperties .getInstance ().getSystemProperty ("git-commit-timestamp" , "unknown" ));
221-
222- logger .info ("[Operating System : {} {} {}]" , System .getProperty ("os.name" ), System .getProperty ("os.version" ), System .getProperty ("os.arch" ));
223- logger .info ("[log4j.configurationFile : {}]" , System .getProperty ("log4j.configurationFile" ));
224- logger .info ("[jetty Version: {}]" , Jetty .VERSION );
225- logger .info ("[{} : {}]" , JETTY_HOME_PROP , configProperties .get (JETTY_HOME_PROP ));
226- logger .info ("[{} : {}]" , JETTY_BASE_PROP , configProperties .get (JETTY_BASE_PROP ));
227- logger .info ("[jetty configuration : {}]" , jettyConfig .toAbsolutePath ().toString ());
217+ logger .info ("[Elemental Version: {}]" , SystemProperties .getInstance ().getSystemProperty ("product-version" , "unknown" ));
218+ logger .info ("[Elemental Build: {}]" , SystemProperties .getInstance ().getSystemProperty ("product-build" , "unknown" ));
219+ logger .info ("[Elemental Git commit: {}]" , SystemProperties .getInstance ().getSystemProperty ("git-commit" , "unknown" ));
220+ logger .info ("[Elemental Git commit timestamp: {}]" , SystemProperties .getInstance ().getSystemProperty ("git-commit-timestamp" , "unknown" ));
221+ logger .info ("[Elemental Home: {}]" , System .getProperty ("exist.home" , "unknown" ));
228222
229223 // configure the database instance
230224 SingleInstanceConfiguration config ;
@@ -233,10 +227,16 @@ public synchronized void run(final String[] args, final Observer observer) {
233227 } else {
234228 config = new SingleInstanceConfiguration ();
235229 }
236- logger .info ("Configuring Elemental from {}" ,
237- config .getConfigFilePath ()
238- .map (Path ::normalize ).map (Path ::toAbsolutePath ).map (Path ::toString )
239- .orElse ("<UNKNOWN>" ));
230+ final String elementalConfigPath = config .getConfigFilePath ()
231+ .map (Path ::normalize ).map (Path ::toAbsolutePath ).map (Path ::toString )
232+ .orElse ("<UNKNOWN>" );
233+ logger .info ("[Elemental Configuration: {}]" , elementalConfigPath );
234+
235+ logger .info ("[Log4j Configuration: {}]" , System .getProperty ("log4j.configurationFile" ));
236+ logger .info ("[Jetty Version: {}]" , Jetty .VERSION );
237+ logger .info ("[Jetty Home: {}]" , configProperties .get (JETTY_HOME_PROP ));
238+ logger .info ("[Jetty Base: {}]" , configProperties .get (JETTY_BASE_PROP ));
239+ logger .info ("[Jetty Configuration: {}]" , jettyConfig .toAbsolutePath ().toString ());
240240
241241 BrokerPool .configure (1 , 5 , config , Optional .ofNullable (observer ));
242242
@@ -257,7 +257,9 @@ public synchronized void run(final String[] args, final Observer observer) {
257257 final List <Object > configuredObjects = new ArrayList <>();
258258 XmlConfiguration last = null ;
259259 for (final Path confFile : configFiles ) {
260- logger .info ("[loading jetty configuration : {}]" , confFile .toString ());
260+ if (logger .isDebugEnabled ()) {
261+ logger .debug ("[Loading Jetty Configuration: {}]" , confFile .toString ());
262+ }
261263 try (final InputStream is = Files .newInputStream (confFile )) {
262264 final XmlConfiguration configuration = new XmlConfiguration (is );
263265 if (last != null ) {
@@ -486,7 +488,9 @@ private Optional<Server> startJetty(final List<Object> configuredObjects) throws
486488
487489 try {
488490 Runtime .getRuntime ().addShutdownHook (shutdownHookThread );
489- logger .debug ("BrokerPoolsAndJetty.ShutdownHook hook registered" );
491+ if (logger .isDebugEnabled ()) {
492+ logger .debug ("BrokerPoolsAndJetty.ShutdownHook hook registered" );
493+ }
490494 } catch (final IllegalArgumentException | IllegalStateException e ) {
491495 // Hook already registered, or Shutdown in progress
492496 logger .error ("Unable to add BrokerPoolsAndJetty.ShutdownHook hook: {}" , e .getMessage (), e );
@@ -499,7 +503,9 @@ private Optional<Server> startJetty(final List<Object> configuredObjects) throws
499503 if (configuredObject instanceof LifeCycle ) {
500504 final LifeCycle lc = (LifeCycle )configuredObject ;
501505 if (!lc .isRunning ()) {
502- logger .info ("[Starting jetty component : {}]" , lc .getClass ().getName ());
506+ if (logger .isDebugEnabled ()) {
507+ logger .debug ("[Starting Jetty Component : {}]" , lc .getClass ().getName ());
508+ }
503509 lc .start ();
504510 }
505511 }
@@ -561,7 +567,9 @@ public synchronized void shutdown() {
561567 shutdownHookThread .ifPresent (thread -> {
562568 try {
563569 Runtime .getRuntime ().removeShutdownHook (thread );
564- logger .debug ("BrokerPoolsAndJetty.ShutdownHook hook unregistered" );
570+ if (logger .isDebugEnabled ()) {
571+ logger .debug ("BrokerPoolsAndJetty.ShutdownHook hook unregistered" );
572+ }
565573 } catch (final IllegalStateException e ) {
566574 // Shutdown in progress
567575 logger .warn ("Unable to remove BrokerPoolsAndJetty.ShutdownHook hook: {}" , e .getMessage ());
@@ -656,7 +664,9 @@ public synchronized boolean isStarted() {
656664
657665 @ Override
658666 public synchronized void lifeCycleStarting (final LifeCycle lifeCycle ) {
659- logger .info ("Jetty server starting..." );
667+ if (logger .isDebugEnabled ()) {
668+ logger .debug ("Jetty server starting..." );
669+ }
660670 setChanged ();
661671 notifyObservers (SIGNAL_STARTING );
662672 status = STATUS_STARTING ;
@@ -665,7 +675,9 @@ public synchronized void lifeCycleStarting(final LifeCycle lifeCycle) {
665675
666676 @ Override
667677 public synchronized void lifeCycleStarted (final LifeCycle lifeCycle ) {
668- logger .info ("Jetty server started." );
678+ if (logger .isDebugEnabled ()) {
679+ logger .debug ("Jetty server started." );
680+ }
669681 setChanged ();
670682 notifyObservers (SIGNAL_STARTED );
671683 status = STATUS_STARTED ;
@@ -678,14 +690,18 @@ public void lifeCycleFailure(final LifeCycle lifeCycle, final Throwable throwabl
678690
679691 @ Override
680692 public synchronized void lifeCycleStopping (final LifeCycle lifeCycle ) {
681- logger .info ("Jetty server stopping..." );
693+ if (logger .isDebugEnabled ()) {
694+ logger .debug ("Jetty server stopping..." );
695+ }
682696 status = STATUS_STOPPING ;
683697 notifyAll ();
684698 }
685699
686700 @ Override
687701 public synchronized void lifeCycleStopped (final LifeCycle lifeCycle ) {
688- logger .info ("Jetty server stopped" );
702+ if (logger .isDebugEnabled ()) {
703+ logger .debug ("Jetty server stopped" );
704+ }
689705 status = STATUS_STOPPED ;
690706 notifyAll ();
691707 }
0 commit comments