RE: [coldbox:6723] Re: Dependency Injection not working for me

Shouldn’t that be ?

Also, you can turn on debug logging for coldbox.system to see information on what is happening.

~Brad

Thank you both. Enabling the logging was a huge help - took me a bit
to figure out how to get it to log, but once I did it was great and I
fixed the issue.

ummm... how DO you turn that on?

Something like this in your ColdBox.cfc config file

    logBox = {
      // Define Appenders
      appenders = {
        coldboxTracer = {
  
class="coldbox.system.logging.appenders.AsyncRollingFileAppender",
          properties={filePath='../logs',
fileName='NameofLogFile', autoExpand=true, fileMaxSize=2000,
fileMaxArchives=10}
        }
      },
      root = { levelMin=logBoxConfig.logLevels.FATAL,
levelMax=logBoxConfig.logLevels.DEBUG, appenders="*"}
    };

Regards,
Andrew Scott
http://www.andyscott.id.au/

From: coldbox@googlegroups.com [mailto:coldbox@googlegroups.com] On
Behalf Of adk
Sent: Friday, 12 November 2010 7:56 AM
To: ColdBox Platform
Subject: [coldbox:6729] Re: Dependency Injection not working for me

ummm... how DO you turn that on?

> Thank you both. Enabling the logging was a huge help - took me a bit
> to figure out how to get it to log, but once I did it was great and I
> fixed the issue.
>
>
> > Shouldn't that be<cfproperty name="modelRC"
inject="coldbox:model:requestService"
> > scope="instance">?
>
> > Also, you can turn on debug logging for coldbox.system to see
information on what is happening.
>
> > ~Brad
>
> > Subject: [coldbox:6723] Re: Dependency Injection not working for me
> > From: Jason <jasonf...@gmail.com>
> > Date: Thu, November 11, 2010 12:07 pm
> > To: ColdBox Platform <coldbox@googlegroups.com> Thank you for the
> > reply. I did change that but it still did not want to work for some
> > reason.
> > So I have the following.
> > <cfproperty name="modelRC" inject="coldbox:requestService"
> > scope="instance">
> > And I am dumping instance in one of the functions so I can see if
> > modelRC is created but it is not in the dump.
> > I am running ColdBox 3.0.0 (M6.2-318-GENESIS-14:14) Jason On Nov 11,
> > > Hi Jason,
>
> > > In latest coldbox version the syntax is like this (type -> inject)
> > > <cfproperty name="modelRC" inject="coldbox:requestService"
> > > scope="instance">
>
> > > Which version of coldbox you are using ...?
>
> > > Thanks
>
>
> > > > Hello,
>
> > > > I am a newbie to ColdBox so please forgive me if I am
> > > > overlooking something very basic. However, I am having a hard
> > > > time getting the dependencies to inject into both my handlers and

my

model.
>
> > > > Here is one example that I am trying to work out. I need to get
> > > > access to event.BuildLink() inside my model, so I did the

following:

>
> > > > 1) I added <cfproperty name="modelRC"
type="coldbox:requestService"
> > > > scope="instance"> at the top of the CFC
> > > > 2) In the function I added:
>
> > > > <cfset var event = instance.modelRC.getContext() />
>
> > > > #event.buildLink('mylinkstuff')#
>
> > > > However I am getting an error that says that ModelRC is
> > > > undefined. In my Coldbox.cfc my IOC configuration is set as
> > > > follows so I can use ColdSpring.
>
> > > > //IOC Integration
> > > > ioc = {
> > > > framework = "coldspring",
> > > > reload = true,
> > > > objectCaching = false,
> > > > definitionFile =

"config/coldspring.xml.cfm"

Thanks for throwing an example out there Andrew. Yes, basically LogBox (which comes baked into ColdBox) let's you set up appenders (or places where your log messages are stored) and configure them to only listen to messages logged from certain places in your application or messages logged with certain severity levels. ColdBox's autowiring automatically logs a ton of debug-level information, but by default, messages with a DEBUG severity are ignored from anywhere within "coldbox.system"; possibly with a config like so:

categories = { "coldbox.system" = { levelMax="INFO" }}

Changing it like so would enable debug messages to be logged from ColdBox's core.

categories = { "coldbox.system" = { levelMax="DEBUG" }}

You can even configure LogBox to use different settings per environment. It's VERY flexible. It's so action packed, it usually makes Luis giddy just thinking about it. :slight_smile:

~Brad

I got giddy just reading about it!!