Just looks like the Logging and Caching properties were not providing the default values to the resolveValueByEnvironment() method. I filed a ticket here which I have already fixed and committed to the trunk:
http://greatbiztoolsllc.trac.cvsdude.com/mach-ii/ticket/342 By default, all loggers and cache strategies are *enabled* if no concrete environment or environment group matches. So if you don't want email logging on in "dev", you'll have to explicitly disable it with: <key name="dev" value="false"/> Or use environment groups (which is my preferred way since you may add additional local groups in the future): <key name="group:local" value="false"/> The order of evaluation for resolving if an something is enabled is: * concrete environment name * environment group * default value (in this case "true") So you could have an environment named "funkyLocal" in the "local" environment group and do this: <key name="funkyLocal" value="true"/> <key name="group:local" value="false"/> Even though the funkyLocal is in the "local" environment group, the logging would be *enabled* because concrete names are checked first before moving on to environment groups and then ultimately the default value (of true) if not matches are found. .Peter What is going on in the EpressionEvaluator.cfc? Can you point me do the problem? Brian Klaas said the following on 07/13/2009 03:16 PM: > This looks similar to the problem outlined in this thread, but is > probably different: > > http://groups.google.com/group/mach-ii-for-coldfusion/browse_thread/thread/af7d138626270b1f/8d0f9ef44ce23f90?lnk=gst&q=environment+property#8d0f9ef44ce23f90 > > I'm receiving the following error message in when I load the > application on my local machine: > > This misconfiguration error occurred in logger named 'MachIIEmailLog' > in module named '_base_'. > > Type: MachII.util.IllegalArgument || Message: Cannot resolve value by > environment name or group and no default value was provided. Provide > an explicit value by environment name, environment group or provide a > default value. Current environment name: 'dev' Current environment > group: 'local' || Detail: > > Here's my environmentConfig.xml file (which is being called _before_ > any other property CFCs in my Mach-II config, so ColdSpring and other > property CFCs are getting the information correctly based on the > environment): > > <mach-ii version="1.0"> > <properties> > <property name="environment" > type="MachII.properties.EnvironmentProperty"> > <parameters> > <parameter name="defaultEnvironmentName" > value="production" /> > <parameter name="dev"> > <struct> > <key name="environmentGroup" > value="local" /> > <key name="servers" > value="localhost" />> > <key name="properties"> > <struct> > <key name="dsn" > value="devDatabase" /> > <key > name="rootPath" value="/some/path" /> > </struct> > </key> > </struct> > </parameter> > <parameter name="testing"> > <struct>-> > <key name="environmentGroup" > value="staging" /> > <key name="servers" > value="ctltdev.jhsph.edu" /> > <key name="properties"> > <struct> > <key name="dsn" > value="devDatabase" /> > <key > name="rootPath" value="D:\testing\path\" /> > </struct> > </key> > </struct> > </parameter> > <parameter name="prod"> > <struct> > <key name="environmentGroup" > value="production" /> > <key name="servers" > value="distance.jhsph.edu" /> > <key name="properties"> > <struct> > <key name="dsn" > value="prodDB" /> > <key > name="rootPath" value="D:\prod\path\" /> > </struct> > </key> > </struct> > </parameter> > </parameters> > </property> > </properties> > </mach-ii> > > And here's my loggingConfig.xml file (which is placed and processed > after environmentConfig.xml): > > <mach-ii version="1.0"> > <properties> > <property name="Logging" type="MachII.logging.LoggingProperty"> > <parameters> > <parameter name="MachIIEmailLog"> > <struct> > <key name="type" > value="MachII.logging.loggers.EmailLog.Logger" / > > <key name="loggingEnabled"> > <struct> > <key > name="testing,prod" value="true"/> > </struct> > </key> > <key name="loggingLevel" > value="fatal" /> > <key name="to" > value="[email protected]" /> > <key name="from" > value="[email protected]" /> > <key name="subject" > value="Fatal Exception Logged" /> > </struct> > </parameter> > </parameters> > </property> > </properties> > </mach-ii> > > Now, if I change the <key name=...> entry in the > MachIIEmailLog.loggingEnabled node to: > > <key name="dev,testing,prod" value="true"/> > > everything works fine and the application loads normally. > > I'm using a copy of the framework downloaded from the SVN repository > today (after having removed the extraneous \ in > ExpressionEvaluator.cfc). > > Any ideas as to why it works when "dev" is included in the key for > "loggingEnabled" but blows up when dev is removed? > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to Mach-II for CFML list. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/mach-ii-for-coldfusion?hl=en SVN: http://greatbiztoolsllc.svn.cvsdude.com/mach-ii/ Wiki / Documentation / Tickets: http://greatbiztoolsllc.trac.cvsdude.com/mach-ii/ -~----------~----~----~----~------~----~------~--~---
