Fix for LOGMGR-42

https://issues.jboss.org/browse/LOGMGR-42

The previous changes did not resolve this issue. This fixes the problem. Includes unittest.