[coldbox-3.5.2] Logbox Categories by RegEx

Has anyone ever thought about this or perhaps I’m going about this the wrong way?

For any CFC that has database interaction, I want a logger available to trap information but ONLY appear in that one appender…I don’t my my sql log entries littered about in other appenders. However, I have database interaction in models and module / models all over the place AND I really want to automatically reference the cfc path in the log entry. What I do now is create a category called SQL, inject that logger via “logbox:logger:SQL” but what I really want to do is “logbox:logger:SQL:{this}” so that the CFC is automatically referenced. Now, I have to prepend my text description of the log information with getMetadata(this).name


Inject logbox instead. Then in your constructor or ondicomplete() get the logger manually.

Also why not build an aop logging advice

Luis Majano
Ortus Solutions, Corp
Toll Free/Fax: 1-888-557-8057
Direct: 909-248-3408
Twitter: @lmajano, @ortussolutions

on the aop option…just not that smart yet.

I am injecting the logger and I think I get what you are saying about ondicomplete and setting something…not sure what yet but I’ll figure it out.


function onDIComplete(){
variables.logger = logbox.getLogger( “categ: #getMetadata( this ).name#” );


Luis F. Majano
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano