I created an app - put in tracers - then got lost. Ha Ha Ha.
I had a hard time remembering where I put all my tracers.
I'm using CB3. I thought there was a way that tracers (or was it
loggers) would automatically display where they were being sent from.
Can anyone help me with this - so that I do not repeat my mistakes?
They should be going to the appenders you declared in your config
Luis F. Majano
President
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
I am using the following Code (with various messages):
<cfset getPlugin("logger").tracer("Need to check credentials
here")>
It works great. However, it does not show where it is coming from.
The next day, I forgot where that was. It took a long time to find
it.
Is there another - better method? If so, what's the syntax for it?
Sorry, guys .... I'm not sure what just happened - except that my
browser closed when I was typing my response.
When it re-launched, I put the reply in and hit "send".
The next thing I know - there are 3 or 4 other the same messages.
I am so sorry guy.
It's not SPAM. Just a goofy "thing".
Use the already configured logger object in every handler, interceptor and plugin. The name is “log”.
log.debug(“my data”)
Luis F. Majano
President
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
The logger object is not automatically available in your model,
though, correct? You either have to use the getPlugin method or inject
it.
Judah
Solved:
Thanks guys .... With the help of Brad Wood's reply and much more
reading, I found an extremely good answer.
log.info("my data") works ok.
log.debug("my data") did not work. It said that "debug" was not a
method of log.
At any rate, this is my solution:
Both of these methods will display the source of the message:
myLogger = logBox.getLogger(this);
myLogger.info("I just created my first logger");
But, the one with great debug info is this one:
myLogger = logBox.getLogger(this);
try{
data = dao.getDBData();
}
catch(Any e){
myLogger.error("Something really died on my dbdata method:
#e.message# #e.detail#",e.tagContext);
}
I had read this page before - but with Brad's note, I knew what to
look for. Here is the page ...
http://ortus.svnrepository.com/coldbox/trac.cgi/wiki/cbLogBox