Felix.log DEBUG

#1

New install of Lucee 5.3.2.74-RC and I am again getting huge felix.log files. They are all DEBUG entries. Looking at this ticket:

https://luceeserver.atlassian.net/browse/LDEV-899

Micha states the following:

Problem was that log level was set to “debug”, changed to “error” now. not sure if we should add a check for the size of the file and clear it when it is bigger than a certain size.

in addition we added the possibility to set the log level an environment variable or system property (“felix.log.level”).

First, this seems to have been set back to DEBUG. Secondly, how/where/syntax can I set the felix.log.level environment or system property?

0 Likes

#2

Does anybody know how/where to set this felix.log.level property?

0 Likes

#3

Just set it as an env var on your machine or pass it as a JVM arg to the server as

-Dfelix.log.level=whatever

Felix does not search directly for env vars or system props, it uses a config file, but Lucee does not expose the default config file, it’s baked into the jar. Sadly, Lucee does not expose some generic way by which devs can control all Felix settings like I wish it would. Instead, Lucee has hand-picked a small subset of Felix properties and they are checked in the CFMLEngineFactory class as part of the initEngine() method.

Here you can see an excerpt from that class that checks for this property and passed it along to a config object that is used to control Felix at run time.

	// Log Level
	int logLevel = 1; // 1 = error, 2 = warning, 3 = information, and 4 = debug
	String strLogLevel = getSystemPropOrEnvVar("felix.log.level", null);
	if (Util.isEmpty(strLogLevel)) strLogLevel = (String) config.get("felix.log.level");

	if (!Util.isEmpty(strLogLevel)) {
	    if ("0".equalsIgnoreCase(strLogLevel)) logLevel = 0;
	    else if ("error".equalsIgnoreCase(strLogLevel) || "1".equalsIgnoreCase(strLogLevel)) logLevel = 1;
	    else if ("warning".equalsIgnoreCase(strLogLevel) || "2".equalsIgnoreCase(strLogLevel)) logLevel = 2;
	    else if ("info".equalsIgnoreCase(strLogLevel) || "information".equalsIgnoreCase(strLogLevel) || "3".equalsIgnoreCase(strLogLevel)) logLevel = 3;
	    else if ("debug".equalsIgnoreCase(strLogLevel) || "4".equalsIgnoreCase(strLogLevel)) logLevel = 4;
	}
	config.put("felix.log.level", "" + logLevel);
0 Likes

#4

Thanks Brad - but I’ve tried that and the felix.log is still filling up with DEBUG entries.

I’ve tried the following settings passed in as Java options in Tomcat:
-Dfelix.log.level=1
-Dfelix.log.level=“1”
-Dfelix.log.level=“error”
-Dfelix.log.level=error

None change anything. I just did another completely fresh install of Lucee 5.3.1.102 on another new server being provisioned and same issue.

0 Likes

#5

Hmm, perhaps something else has changed. You’d probably have to compile a Lucee jar with some debugging in place to try and figure out which of that startup code is getting triggered.

0 Likes