[
https://issues.jboss.org/browse/LOGMGR-120?page=com.atlassian.jira.plugin...
]
David Lloyd commented on LOGMGR-120:
------------------------------------
The only reason we need the system property is because thread local access is very slow
compared to our existing volatile int read. So this functionality would have to be
enabled by a boolean constant field that we initialize from a system property so that C2
can eliminate the extra code completely when it isn't enabled, something like this:
{code}
final int effectiveLevel = loggerNode.getEffectiveLevel();
if ((level.intValue() < effectiveLevel || effectiveLevel == OFF_INT) &&
!(PER_THREAD_ENABLED && level.intValue() < threadLocal.get().intValue())) {
return;
}
{code}
If C2 compiles this code and PER_THREAD_ENABLED is false, it reduces like this:
{code}
if ((level.intValue() < effectiveLevel || effectiveLevel == OFF_INT) &&
!(PER_THREAD_ENABLED && level.intValue() < threadLocal.get().intValue())) {
// becomes:
if ((level.intValue() < effectiveLevel || effectiveLevel == OFF_INT) &&
!(false && level.intValue() < threadLocal.get().intValue())) {
// becomes:
if ((level.intValue() < effectiveLevel || effectiveLevel == OFF_INT) &&
!(false)) {
// becomes:
if ((level.intValue() < effectiveLevel || effectiveLevel == OFF_INT) &&
true) {
// becomes:
if (level.intValue() < effectiveLevel || effectiveLevel == OFF_INT) {
// ...which is the original code == just as fast.
{code}
Thread local log level overriding
---------------------------------
Key: LOGMGR-120
URL:
https://issues.jboss.org/browse/LOGMGR-120
Project: JBoss Log Manager
Issue Type: Feature Request
Components: core
Affects Versions: 1.5.2.Final
Reporter: Matthew Robson
Assignee: James Perkins
Having the ability to force logs down to a filter no matter what the log level is set to.
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)