How to inject Logbox into a Service with Ioc still being powered by ColdSpring?

I would like to know how would one inject Logbox into a Service while not using wirebox?

Thanks,
Henry

Using cold spring or manual injection?

Hi Luis,

This is a ColdBox app. I’m using the following in Coldbox.cfc

ioc = {
framework = “coldspring”,
definitionFile = “/coldspring.xml”
}

Since I’m not using WireBox, I don’t know how to inject the LogBox into a Service currently handled by coldspring?

Thanks,
Henry

Henry,

Since you are using ColdSpring as your container, you will need to do it from ColdSpring. We have a ColdBoxFactory object in the ioc package that can be used to retrieve anything from the running application via ColdSpring. It is very easy to setup.

Just add it as another bean declaration to your coldspring declaration file that points to that factory. Then you can declare beans that use the ColdBoxFactory as a parent bean.

Are you familiar with bean factory methods? If not, I can look for some examples for you.

Also, on another topic, you know you can easily switch between coldspring and wirebox if you wanted to try it? We can even convert your ColdSpring xml file to WireBox CFC if you like. Let me know if you are interested, and I can do a connect session with you and show you a few tips

Thanks

http://www.coldbox.org/documents/api/ColdBoxDocs-3.5.0.Beta/coldbox/system/ioc/ColdboxFactory.html

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

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

What is the default COLDBOX_APP_KEY? I currently don’t have one defined in Application.cfc.

Thanks,
Henry

You don’t need one by default. This is only for people doing multiple coldbox apps using different named keys in application scope. 99% of the time you don’t care.

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

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