APISonar


lucee.commons.io.log.LogUtil.log

> lucee > commons > io > log > LogUtil > log
lucee APIs commons APIs io APIs log APIs LogUtil APIs log APIs

Example 1
private static void log(int level, String msg) {
		try {
			Config config = ThreadLocalPageContext.getConfig();
			Log log = config != null ? config.getLog("application") : null;
			if (log != null) log.log(level, "OSGi", msg);
		}
		catch (Exception t) {
			LogUtil.log(null, level, BundleBuilderFactory.class.getName(), msg);
		}
	}
Example 2
private void initAddionalParams() {
		try {
			Method m = clazz.getMethod(getName(), getParameterTypes());
			exceptionTypes = m.getExceptionTypes();
			returnType = m.getReturnType();
		}
		catch (Exception e) {
			LogUtil.log(null, ASMMethod.class.getName(), e);
		}

	}
Example 3
public List getVariables() {
		Iterator it = getScopeNames().iterator();
		List list = new ArrayList();

		while (it.hasNext()) {
			try {
				getVariables(this, pc, list, (String) it.next());
			}
			catch (FDLanguageException e) {
				LogUtil.log(null, "integral", e);
			}
		}
		return sort(list);
	}
Example 4
private static void printError(Exception t, ORMEngine engine, String msg) {
		if (engine != null) LogUtil.log(ThreadLocalPageContext.getConfig(), Log.LEVEL_ERROR, ORMUtil.class.getName(), "{" + engine.getLabel().toUpperCase() + "} - " + msg);
		else LogUtil.log(ThreadLocalPageContext.getConfig(), Log.LEVEL_ERROR, ORMUtil.class.getName(), msg);

		if (t == null) t = new Exception();
		LogUtil.log(ThreadLocalPageContext.getConfig(), ORMUtil.class.getName(), t);
	}
Example 5
public String toString() {
		String hashText = null;

		try {
			hashText = Hash.getHashText(this.plainText, this.algorithm);
		}
		catch (NoSuchAlgorithmException nsae) {
			LogUtil.log(null, Hash.class.getName(), nsae);
		}

		return hashText;
	}
Example 6
private void shutdownFelix() {
		CFMLEngineFactory f = getCFMLEngineFactory();
		try {
			Method m = f.getClass().getMethod("shutdownFelix", new Class[0]);
			m.invoke(f, new Object[0]);
		}
		// FUTURE do not use reflection
		// this will for sure fail if CFMLEngineFactory does not have this method
		catch (Exception e) {
			LogUtil.log(configServer, "controller", e);
		}
	}
Example 7
private ConfigServerImpl getConfigServerImpl() {
		if (configServer == null) {
			try {
				Resource context = getSeverContextConfigDirectory(factory);
				configServer = XMLConfigServerFactory.newInstance(this, initContextes, contextes, context);
			}
			catch (Exception e) {
				e.printStackTrace();
				LogUtil.log(configServer, "startup", e);
			}
		}
		return configServer;
	}
Example 8
protected void setGatewayEntries(Map<String, GatewayEntry> gatewayEntries) {
		try {
			getGatewayEngine().addEntries(this, gatewayEntries);
		}
		catch (Exception e) {
			LogUtil.log(ThreadLocalPageContext.getConfig(this), ConfigWebImpl.class.getName(), e);
		}
	}
Example 9
public void resetPageContext() {
		LogUtil.log(config, Log.LEVEL_INFO, CFMLFactoryImpl.class.getName(), "Reset " + pcs.size() + " Unused PageContexts");
		pcs.clear();
		Iterator<PageContextImpl> it = runningPcs.values().iterator();
		while (it.hasNext()) {
			it.next().reset();
		}
	}
Example 10
private void store(SpoolerTask task) {
		ObjectOutputStream oos = null;
		Resource persis = getFile(task);
		if (persis.exists()) persis.delete();
		try {
			oos = new ObjectOutputStream(persis.getOutputStream());
			oos.writeObject(task);
		}
		catch (IOException e) {
			LogUtil.log(ThreadLocalPageContext.getConfig(), SpoolerEngineImpl.class.getName(), e);
		}
		finally {
			IOUtil.closeEL(oos);
		}
	}
Example 11
public String getLicenseInformation(String key) {
		if (!isEnterprise) {
			LogUtil.log(null, Log.LEVEL_ERROR, "integral",
					"FD Server Licensing does not work with the Open Source Version of Lucee or Enterprise Version of Lucee that is not enabled");
			return null;
		}
		return FDLicense.getLicenseInformation(key);
	}
Example 12
public void compile(String realPath) throws PageException {
		LogUtil.log(config, Log.LEVEL_INFO, PageContextImpl.class.getName(), "method PageContext.compile(String) should no longer be used!");
		compile(PageSourceImpl.best(getRelativePageSources(realPath)));
	}
Example 13
protected void setTempDirectory(Resource tempDirectory, boolean flush) throws ExpressionException {
		if (!isDirectory(tempDirectory) || !tempDirectory.isWriteable()) {
			LogUtil.log(this, Log.LEVEL_ERROR, "loading",
					"temp directory [" + tempDirectory + "] is not writable or can not be created, using directory [" + SystemUtil.getTempDirectory() + "] instead");

			tempDirectory = SystemUtil.getTempDirectory();
			if (!tempDirectory.isWriteable()) {
				LogUtil.log(this, Log.LEVEL_ERROR, "loading", "temp directory [" + tempDirectory + "] is not writable");
			}
		}
		if (flush) ResourceUtil.removeChildrenEL(tempDirectory);// start with a empty temp directory
		this.tempDirectory = tempDirectory;
	}
Example 14
public PageSource getRelativePageSource(String realPath) {
		LogUtil.log(config, Log.LEVEL_INFO, PageContextImpl.class.getName(), "method getRelativePageSource is deprecated");
		if (StringUtil.startsWith(realPath, '/')) return PageSourceImpl.best(getPageSources(realPath));
		if (pathList.size() == 0) return null;
		return pathList.getLast().getRealPage(realPath);
	}
Example 15
public static void function(PageContext pc, String old, String replacement) {
		pc = ThreadLocalPageContext.get(pc);
		if (pc == null) return;
		LogUtil.log(ThreadLocalPageContext.getConfig(pc), Log.LEVEL_ERROR, DeprecatedUtil.class.getName(),
				"function " + old + " is deprecated, please use instead function " + replacement);
	}
Example 16
public void evaluate(BIF bif, FunctionLibFunction flf) throws EvaluatorException {
		Variable var = bif.getParent();
		if (var != null) {
			Assign ass = var.assign();
			if (ass != null) {
				try {
					String str = VariableString.variableToString(ass.getVariable(), false);
					addArgument(bif, str);
				}
				catch (TransformerException e) {
					LogUtil.log(null, QueryExecute.class.getName(), e);
				}
			}
		}
	}
Example 17
public static boolean isTemplate(PageContext pc, PageSource ps, boolean defaultValue) {
		try {
			return !(ps.loadPage(pc, false) instanceof CIPage);
		}
		catch (PageException e) {
			LogUtil.log(ThreadLocalPageContext.getConfig(pc), PageSourceImpl.class.getName(), e);
			return defaultValue;
		}
	}
Example 18
public void add(DatasourceConnection dc) {
		// make sure the connection is not already in stack, this can happen when the conn is released twice
		Item test = item;
		while (test != null) {
			if (test.dc == dc) {
				LogUtil.log(ThreadLocalPageContext.getConfig(), Log.LEVEL_INFO, DCStack.class.getName(), "a datasource connection was released twice!");
				return;
			}
			test = test.prev;
		}

		item = new Item(item, dc);
	}