diff --git a/base/src/org/compiere/Adempiere.java b/base/src/org/compiere/Adempiere.java index d00a15fdad..1440a12682 100644 --- a/base/src/org/compiere/Adempiere.java +++ b/base/src/org/compiere/Adempiere.java @@ -455,6 +455,11 @@ public final class Adempiere return url.getHost(); } // getCodeBase + public static synchronized boolean isStarted() + { + return (log != null); + } + /************************************************************************* * Startup Client/Server. * - Print greeting, @@ -477,6 +482,7 @@ public final class Adempiere System.exit(1); Ini.setClient (isClient); // init logging in Ini + CLogMgt.initialize(isClient); // Init Log log = CLogger.getCLogger(Adempiere.class); // Greeting diff --git a/base/src/org/compiere/model/GridTable.java b/base/src/org/compiere/model/GridTable.java index ab039ed740..c0f43ecb50 100644 --- a/base/src/org/compiere/model/GridTable.java +++ b/base/src/org/compiere/model/GridTable.java @@ -88,7 +88,7 @@ public class GridTable extends AbstractTableModel implements Serializable { /** - * + * generated */ private static final long serialVersionUID = 7799823493936826600L; diff --git a/base/src/org/compiere/util/CLogFile.java b/base/src/org/compiere/util/CLogFile.java index 29fa44001d..965b517a2b 100644 --- a/base/src/org/compiere/util/CLogFile.java +++ b/base/src/org/compiere/util/CLogFile.java @@ -276,6 +276,7 @@ public class CLogFile extends Handler // if (record.getLevel() == Level.SEVERE || record.getLevel() == Level.WARNING + || record.getLevel() == Level.OFF || m_records % 10 == 0) // flush every 10 records flush(); } diff --git a/base/src/org/compiere/util/CLogMgt.java b/base/src/org/compiere/util/CLogMgt.java index 1c7d5b62c7..a1988acce5 100644 --- a/base/src/org/compiere/util/CLogMgt.java +++ b/base/src/org/compiere/util/CLogMgt.java @@ -275,6 +275,7 @@ public class CLogMgt return; Logger rootLogger = Logger.getLogger(getRootLoggerName()); rootLogger.setUseParentHandlers(false); + rootLogger.setLevel(level); Handler[] handlers = rootLogger.getHandlers(); if (handlers == null || handlers.length == 0) { @@ -286,6 +287,7 @@ public class CLogMgt { handlers[i].setLevel(level); } + // JDBC if ALL setJDBCDebug(level.intValue() == Level.ALL.intValue()); // diff --git a/base/src/org/compiere/util/Ini.java b/base/src/org/compiere/util/Ini.java index 835cb3dc2d..63e1ffb36b 100644 --- a/base/src/org/compiere/util/Ini.java +++ b/base/src/org/compiere/util/Ini.java @@ -234,7 +234,7 @@ public final class Ini implements Serializable private static String s_propertyFileName = null; /** Logger */ - private static Logger log = Logger.getLogger(Ini.class.getName()); + private static Logger log = null; /** * Save INI parameters to disk @@ -284,6 +284,7 @@ public final class Ini implements Serializable */ public static void loadProperties (boolean reload) { + log = Logger.getLogger(Ini.class.getName()); if (reload || s_prop.size() == 0) { if (isWebStartClient()) @@ -690,7 +691,7 @@ public final class Ini implements Serializable public static final String ADEMPIERE_HOME = "ADEMPIERE_HOME"; /** IsClient Internal marker */ - private static boolean s_client = true; + private static boolean s_client = false; /** IsClient Internal marker */ private static boolean s_loaded = false; /** Show license dialog for first time **/ @@ -711,8 +712,7 @@ public final class Ini implements Serializable */ public static void setClient (boolean client) { - s_client = client; - CLogMgt.initialize(client); + s_client = client; } // setClient /** diff --git a/client/META-INF/MANIFEST.MF b/client/META-INF/MANIFEST.MF index ed00a09f5d..32d709aee2 100644 --- a/client/META-INF/MANIFEST.MF +++ b/client/META-INF/MANIFEST.MF @@ -24,7 +24,6 @@ Export-Package: de.schaeffer.compiere.tools, org.eevolution.form Require-Bundle: org.adempiere.base;bundle-version="1.0.0", org.adempiere.tools;bundle-version="1.0.0" -Bundle-Activator: org.adempiere.client.Activator Eclipse-ExtensibleAPI: true Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Import-Package: org.eclipse.core.runtime;version="3.4.0", diff --git a/client/src/org/adempiere/client/Activator.java b/client/src/org/adempiere/client/Activator.java deleted file mode 100644 index 5a330dca93..0000000000 --- a/client/src/org/adempiere/client/Activator.java +++ /dev/null @@ -1,33 +0,0 @@ -package org.adempiere.client; - -import org.compiere.util.CLogger; -import org.eclipse.core.runtime.Plugin; -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleContext; -import org.osgi.framework.BundleException; - -public class Activator extends Plugin { - private static final String ADMEPIERE_PREFIX = "org.adempiere"; - private static CLogger log = CLogger.getCLogger(Activator.class); - - @Override - public void start(BundleContext context) throws Exception { - activateAll(context.getBundles()); - } - - private void activateAll(Bundle[] bundles) { - for (Bundle bundle : bundles) { - if (shouldStart(bundle)) - try { - bundle.start(); - log.info("Started "+bundle.getSymbolicName()); - } catch (BundleException e) { - log.warning("Could not start "+bundle.getSymbolicName()); - } - } - } - - private boolean shouldStart(Bundle bundle) { - return bundle.getSymbolicName().startsWith(ADMEPIERE_PREFIX); - } -}