It seems that my LogBox is not working correctly anymore. I am not sure what has happened. I am getting the following error in my CF application log when I try to add an entry:
LOGMESSAGE_8E7FE314E1985B14B58F040607D398AB: Variable THISAPPENDER is undefined.
OK, I added the var scope and restarted my CF service. Error still occurs. The exception log points to: (C:\ColdFusion10\cfusion\wwwroot\coldbox\system\logging\Logger.cfc:340)
Hmm, well technically I guess it could be related. Since no stack trace was provided, I guessed where the error was happening. Perhaps the var scoping issue I found was just a coincident. Chad, can you share a stack trace with us that shows where the error is actually happening?
FYI… I just tried version coldbox-4.0.0-rc+00002-201410230827 and logging works fine. The version I am on where the error occurs is coldbox-4.0.0+00002-201501211101.
Ok, I see the issue. The problem is that the appender might exist in the root logger and not the local local. Therefore it does not exist locally.
Actually Don Q’s approach works but it is not ultimately kosher as it adds the missing appender when the appender belongs to the other logger category.
I think the best solution is to pass it into the threed to avoid the collision.
Luis Majano
CEO
Ortus Solutions, Corp www.ortussolutions.com
P/F: 1-888-557-8057
Direct: (909) 248-3408
Remember Luis, as per the comment thread on the pull request that Don linked to, we can’t pass in the appender instance as an attribute to the thread or it will be duplicated by a deep copy (this is how cfthread works) It needs to be accessed from a shared scope.