diff --git a/org.adempiere.base/src/org/adempiere/base/PackInFolderApplication.java b/org.adempiere.base/src/org/adempiere/base/PackInFolderApplication.java index 880b0450ce..5caef4bfb7 100644 --- a/org.adempiere.base/src/org/adempiere/base/PackInFolderApplication.java +++ b/org.adempiere.base/src/org/adempiere/base/PackInFolderApplication.java @@ -49,12 +49,24 @@ public class PackInFolderApplication implements IApplication { @Override public Object start(IApplicationContext context) throws Exception { Adempiere.startup(false); - CLogMgt.setLevel(Level.FINE); - + String logLevel = System.getProperty("LogLevel"); + if (logLevel == null) + logLevel = "INFO"; + switch (logLevel) { + case "SEVERE": CLogMgt.setLevel(Level.SEVERE); break; + case "WARNING": CLogMgt.setLevel(Level.WARNING); break; + case "INFO": CLogMgt.setLevel(Level.INFO); break; + case "CONFIG": CLogMgt.setLevel(Level.CONFIG); break; + case "FINE": CLogMgt.setLevel(Level.FINE); break; + case "FINER": CLogMgt.setLevel(Level.FINER); break; + case "FINEST": CLogMgt.setLevel(Level.FINEST); break; + default: CLogMgt.setLevel(Level.INFO); break; + } Map args = context.getArguments(); String commandlineArgs[] = (String[]) args.get("application.args"); if (commandlineArgs.length == 1) { Properties ctx = Env.getCtx(); + Env.setContext(ctx, "org.adempiere.base.PackInFolderApplication", "Y"); String directory = commandlineArgs[0]; ProcessInfo pi = new ProcessInfo("PackInFolder", 200099); pi.setAD_Client_ID(0); diff --git a/org.adempiere.plugin.utils/src/org/adempiere/plugin/utils/PackInApplicationActivator.java b/org.adempiere.plugin.utils/src/org/adempiere/plugin/utils/PackInApplicationActivator.java index fc7615fa5e..eb9369aa92 100644 --- a/org.adempiere.plugin.utils/src/org/adempiere/plugin/utils/PackInApplicationActivator.java +++ b/org.adempiere.plugin.utils/src/org/adempiere/plugin/utils/PackInApplicationActivator.java @@ -118,6 +118,7 @@ public class PackInApplicationActivator extends AbstractActivator { t.schedule(new TimerTask() { @Override public void run() { + if (! "Y".equals(Env.getContext(Env.getCtx(), "org.adempiere.base.PackInFolderApplication"))) { ClassLoader cl = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(PackInApplicationActivator.class.getClassLoader()); @@ -128,7 +129,8 @@ public class PackInApplicationActivator extends AbstractActivator { service = null; Thread.currentThread().setContextClassLoader(cl); } - t.cancel(); + } + t.cancel(); } }, timeout); } else {