Project

General

Profile

log_fixes.diff

Hynek Cihlar, 02/26/2023 09:11 AM

Download (3.84 KB)

View differences:

new/build.gradle 2023-02-26 13:41:19 +0000
570 570
    fwdClient group: 'gettext', name: 'gettext.js', version: '1.2.0', ext: 'zip' // WARNING: this zip name is hardcoded in WebResourceHandler
571 571
    fwdClient group: 'org.apache.tika', name: 'tika-core', version: '1.18'
572 572
    
573
    gwtRuntime group: 'com.google.gwt', name: 'gwt-user', version: '2.9.0'
574
    gwtRuntime group: 'com.googlecode.gwt-validation', name: 'gwt-validation', version: '2.1'
573
    gwtRuntime group: 'com.google.gwt', name: 'gwt-user', version: '2.10.0'
574
    gwtRuntime (group: 'com.googlecode.gwt-validation', name: 'gwt-validation', version: '2.1') {
575
        exclude group: 'org.slf4j', module: 'slf4j-simple'
576
    }
575 577
    
576 578
    gwtRuntime group: 'org.freemarker', name: 'freemarker', version: '2.3.31'
577 579
    gwtRuntime (group: 'com.gwtplatform', name: 'gwtp-mvp-client', version: '1.6') {
new/src/com/goldencode/p2j/main/ClientDriver.java 2023-02-26 14:00:51 +0000
417 417
   {
418 418
      // for web and batch clients only redirect stderr to a log file
419 419
      setClientLog(args);
420

  
421
      // init default log format after redirecting stderr above!
422
      // do this as early as possible to ensure the same log format is used for log outputs before and
423
      // after logging is configured
424
      com.goldencode.p2j.util.LogHelper.initDefaultLoggingOptions();
420 425
      
421 426
      ClientDriver client = new ClientDriver();
422 427
      
new/src/com/goldencode/p2j/main/ServerDriver.java 2023-02-26 14:00:51 +0000
114 114
package com.goldencode.p2j.main;
115 115

  
116 116
import java.net.*;
117
import java.security.*;
118
import javax.net.ssl.*;
119
import org.bouncycastle.jsse.provider.*;
117

  
120 118
import com.goldencode.p2j.aspects.ltw.*;
121 119
import com.goldencode.p2j.cfg.*;
122 120
import com.goldencode.p2j.directory.*;
......
124 122
import com.goldencode.p2j.net.*;
125 123
import com.goldencode.p2j.security.*;
126 124
import com.goldencode.p2j.security.SecurityManager;
127
import com.goldencode.p2j.security.SecurityManager.*;
128 125
import com.goldencode.p2j.util.*;
129 126

  
130 127
/**
......
953 950
    */
954 951
   public static void main(String[] args)
955 952
   {
953
      // do this as early as possible to ensure the same log format is used for log outputs before and
954
      // after logging is configured
955
      LogHelper.initDefaultLoggingOptions();
956

  
956 957
      ServerDriver server = new ServerDriver();
957 958
      FwdJMX.init();
958 959
      server.process(args);
new/src/com/goldencode/p2j/util/LogHelper.java 2023-02-26 14:00:51 +0000
306 306
         return initWorker(fhClass);
307 307
      }
308 308
   }
309

  
310
   /**
311
    * Configures default logging options. This method performs all the necessary logging changes early at
312
    * the process startup. The security context is not accessed from this method.
313
    */
314
   public static void initDefaultLoggingOptions()
315
   {
316
      // ensure the correct log format is used even before logging is configued from the directory
317
      CleanFormatter f = new CleanFormatter();
318
      Logger rootLogger = Logger.getLogger("");
319
      Handler[] handlers = rootLogger.getHandlers();
320
      for (Handler handler : handlers) {
321
         handler.setFormatter(f);
322
      }
323

  
324
      // force Jetty to send log output to java.util.logging
325
      System.setProperty("org.eclipse.jetty.util.log.class", "org.eclipse.jetty.util.log.JavaUtilLog");
326
   }
309 327
      
310 328
   /**
311 329
    * Retrieve a logging object from the <code>LogManager</code>.