[coldbox:4208] logbox questions

Hi,

Im thinking about using logbox, but i have some questions first.

1. Performance: I tend to use lots of logging statements in my code,
so if something goes wrong, i can set the log level at info and follow
what the code all did. When making logbox, has there been much thought
in its performance? Also, in concurrency issues?

2. I basically place all my app-specific cfc's with the coldbox app i
make. I have another package, called 'common', in which i throw
everything that is re-usable, i try to make most things there coldbox-
independent.
I really miss static functions in coldfusion, so you can do things
like this (in java):

private Logger theLogger
=Logger.getLogger(HelloWorld.class.getName());

In coldfusion you have either to use createobject, or inject it with
coldfspring, but especially in my common package, injecting a logger
into every cfc is a pain.

I made my own logger, which works a lot like logbox, but i noticed all
these createobjects take quite some memory, especially when they are
created in reactor records, or beans, of which a lot can exist at the
same time in some situations.

How is the above solved in logbox?

The other problem, but less a problem, is that because i cant inject
it, i cant propagate the same settings to all logger instances. But i
figured that maybe the automatic detection of a config file by logbox
in the config dir (this is right yes?) will overcome that, because
cfc's in my common package are always created in a coldbox
application.

Again, i dont want to have dependencies on anything other then logbox
when i use it for logging in my framework-independent common package.

Greets,
klaas

  1. Performance: I tend to use lots of logging statements in my code,
    so if something goes wrong, i can set the log level at info and follow
    what the code all did. When making logbox, has there been much thought
    in its performance? Also, in concurrency issues?

Yes sir, we are always about performance, and logbox performs very nicely, especially if you use any of the multithreaded appenders. It is also thread safe.

  1. How is the above solved in logbox?
    Several ideas here. If you are already using ColdBox you are golden as plugins, interceptors, handlers, layouts, and views already have loggers configured for them as “variables.log” and you can use it to log anything on them.

If you are using dependency injection via WireBox in a coldbox application you also have the LogBox autowire DSL:
property name=“logBox” inject=“logBox”
property name=“log” inject=“logBox:root”
property name=“log” inject=“logBox:category:categoryName”

Which wires up your domain objects with logging capabilities.

Unfortunately yes, there are no static abilities, so I suggest creating the logBox factory and persist it somewhere, our preference is via a DI framework and then just use it as a factory bean to inject loggers or just inject it and get a logger from it at construction.

The other problem, but less a problem, is that because i cant inject
it, i cant propagate the same settings to all logger instances. But i
figured that maybe the automatic detection of a config file by logbox
in the config dir (this is right yes?) will overcome that, because
cfc’s in my common package are always created in a coldbox
application.
The automatic detection of configuration files are done by ColdBox not LogBox. So this is separate. YOu can have your configuration for LogBox in a simple CFC, a programmatic approach or XML. The first one is our preference and the most portable as a simple CFC.
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