Twitter: raymondcamden


Address: Lafayette, LA, USA

Warning about ColdFusion 10 and ORM Logging

01-17-2014 2,941 views ColdFusion 11 Comments

First off, credit for this post belongs to multiple people. This post stems from a discussion on a private listserv of ColdFusion developers. I'll make a list of folks at the end, but in this case, I'm mainly serving as the 'errand boy' to report the issue and help spread the word. I'll do my best to describe the issue accurately but any screw up is entirely my fault.

In ColdFusion 9 (and in the docs for ColdFusion 10 but not actually implemented), the log settings for ORM (as set in cfhome\lib\log4j.properties) is:

log4j.appender.HIBERNATECONSOLE=org.apache.log4j.ConsoleAppender

This means ORM-related messages are logged to the console. But in ColdFusion 10, this switched to:

log4j.appender.HIBERNATECONSOLE= org.apache.log4j.FileAppender

Another issue is that in ColdFusion 9, these two settings...

log4j.appender.HIBERNATECONSOLE.MaxFileSize=500KB
log4j.appender.HIBERNATECONSOLE.MaxBackupIndex=3

are commented out. You can probably guess what the result is - a (potentially!) huge ass log file. Most likely you want to change to a rolling file appender as described here: ColdFusion ORM : How to log SQL.

If you use ORM, I'd recommend checking your logs now and updating your settings as well.

Credit: Sam Farmer, Phill Nacelli, and anyone else I forgot.

11 Comments

  • Commented on 01-17-2014 at 4:40 PM
    > a private listserv of ColdFusion developers

    Details? How private?
  • Commented on 01-17-2014 at 10:13 PM
    But I have one question, is there any reason why these settings can not also be set at the application layer as well. For example shared hosting and those who run multiple sites for their clients, could benefit from the ability to just switch on the logging for that application only as well as where to store these log files.
  • Commented on 01-17-2014 at 11:08 PM
    Ya, I got bitten by it few time. Do you know if there is an ER already logged for this for CF 11?
  • Ryan Guill #
    Commented on 01-18-2014 at 7:51 AM
    Yeah, we have been bitten as well. On one server it got to > 70gb before we discovered it, and on another we forgot to turn that setting off when we went to production on a legacy server without a lot of disk space and didn't remember until it had filled the disk up with > 100gb in that one file.

    I agree as well that the application level setting should control it, or at very least have an admin level setting.

    If someone discovers or creates an ER let me know, I would like to vote for it.
  • Commented on 01-18-2014 at 9:02 AM
    @john: Sorry, I can't.
    @andrew: I agree. :)
    @Sumit: Yes - it should already be corrected in 11.
  • Commented on 01-18-2014 at 3:50 PM
    John, Ray's almost certainly talking about the ColdFusion 11 Pre-Release programme. People on it like to be secretive about their membership of it despite there being no reason to be (it's not part of the NDA they... and I... all signed).

    What they can't repeat is the discussions that go on there. I can only presume Ray got special sanction to raise this here. Otherwise this blog post would be breaking the NDA...

    --
    Adam
  • Commented on 01-18-2014 at 5:24 PM
    https://bugbase.adobe.com/index.cfm?event=bug&...
  • Commented on 01-18-2014 at 8:39 PM
    Adam, it really wasn't relevant - that's why I didn't specify the listserv. It wasn't part of me trying to be secretive - it just didn't matter.

    Andrew, thanks - voting it up now.
  • Commented on 01-18-2014 at 9:15 PM
    No problem Ray, I am just surprised something like this has not been raised before.

    On a side note, while talking about ORM & Logging... Does anyone have any actual stats, to show how much overhead logging can add to the request?

    I am trying to gauge how slow is too slow, when it comes to CF-ORM.
  • Pat Branley #
    Commented on 01-19-2014 at 5:35 PM
    Another 'problem'

    log4j.appender.HIBERNATECONSOLE.File=/opt/coldfusion10/cfusion/logs/hibernatesql.log

    so this means its logging to the default instances log folder. However, if you are running multi instance CF10, then this is logging to the wrong instance folder.
  • Commented on 01-20-2014 at 7:51 AM
    Thanks for posting Ray (my blog has retired). Though I thought the first rule of fight club was...etc, etc.

    Adam, Andrew: There is a bug out there for this:
    https://bugbase.adobe.com/index.cfm?event=bug&...

Post Reply

Please refrain from posting large blocks of code as a comment. Use Pastebin or Gists instead. Text wrapped in asterisks (*) will be bold and text wrapped in underscores (_) will be italicized.

Leave this field empty