Ticket #378 (closed enhancement: fixed)

Opened 16 years ago

Last modified 16 years ago

Disable trace logging of complex values when the debug config setting is "none"

Reported by: boomfish Owned by:
Priority: normal Milestone: 3.1 Maintenance Beta
Version: 3.0.178 Severity: minor
Keywords: performance Cc:

Description

The addTraceStatement() method in EventContext.cfc is very non-performant when the message argument is a complex value.

The actions in addTraceStatement() are not needed when framework debugging is turned off, so a simple enhancement to address the performance issue is to have addTraceStatement() act as a no-op when getModelGlue().getConfigSetting("debug") is "none".

References:

http://groups.google.com/group/model-glue/browse_frm/thread/d59bbf06b8dc0478

http://groups.google.com/group/model-glue/browse_frm/thread/5aca2fb082d63c68

Change History

Changed 16 years ago by DanWilson

  • status changed from new to closed
  • resolution set to fixed

This is fixed as of revision 209.

Here is the way it works:

addTraceStatement does nothing to the data it is asked to trace. It merely calls the logWriter. The logWriter is now configurable in ColdSpring? and gets the value of debug when the application loads. If debug is set to true, then complex values will be converted to simple values, then logged. If the value was originally a simple value, it is just logged. If debug is set to false, then nothing is convered to simple values nor logged.

You can now provide your own implementation of the logWriter. All you need to do is create an entry in your ColdSpring?.xml with the bean ID of modelGlue.logWriter and make sure to link it to your modelGlue.modelGlueConfiguration bean so it'll know the debug status:

<bean id="modelglue.logWriter" class="ModelGlue?.gesture.eventrequest.log.LogWriter?">

<constructor-arg name="debugMode"><bean factory-bean="modelglue.modelGlueConfiguration" factory-method="getDebug" /></constructor-arg>

</bean>

Now you can do whatever you want to when logging. Want to surpress all complex value logging? Go for it. Want to log remote requests and nothing else, while in production? You can easily do that.

And of course, you never ever have to touch a core Model Glue file to accomplish this. Don't believe me? Read http://docs.model-glue.com/wiki/FAQs/HowDoICustomizeTheModelGlueFramework

Changed 16 years ago by boomfish

  • status changed from closed to reopened
  • summary changed from Disable trace logging when the debug config setting is "none" to Disable trace logging of complex values when the debug config setting is "none"
  • resolution fixed deleted
  • milestone changed from 3.2 to 3.1.x-next-patch

Reopening ticket to get the fix backported to 3.1.x-next-patch.

Changed 16 years ago by boomfish

  • status changed from reopened to closed
  • resolution set to fixed

Fix merged into MG_3.1_fixes branch in SVN commit 229.

Note: See TracTickets for help on using tickets.