Skip to main content
Inspiring
August 27, 2009
Question

CFLOG Precision

  • August 27, 2009
  • 1 reply
  • 1224 views

Has anybody found a way to have better time precision in CFLOG?  I have quite a few batch processes where I like to write to a log as the process runs so I can track how long various steps take, where it leaves off, etc.  But the problem is that the logs seem to only have precision to the nearest minute--if I have several steps which finish and cflog within the same minute (i.e. 4:55), they don't necessarily appear in the right order.  Is there any way to make the cflog entries have at least to-the-second precision, if not better?  It would just make a useful tool much more useful.

I realize I could create my own text file logs, but the ease of accessing the logs through the Admin is quite a significant benefit.

    This topic has been closed for replies.

    1 reply

    Inspiring
    August 27, 2009

    As mentioned here, you can change the default pattern in neo-logging.xml to include milliseconds.

         <var name='pattern'><string>"%p","%t",%d{"MM/dd/yy","HH:mm:ss:SS"},%a,"%m%x"%n</string>

    BUT .. that will affect all log files, not just cflog.  I am not sure how you hone in on a single log file..

    Inspiring
    August 28, 2009

    Sadly, this doesn't really solve my issue.  You can add milliseconds to the timestamp in the neo-logging.xml file, and it does write the additional data to the log files, but that also makes the files unreadable by the CF Admin (you get an invalid date/time format error).  So unless I wanted to forgo the CF Admin, this doesn't work.

    I noticed that before making that change, the entries in the log files do have the second stamp, and while the CF Admin does seem to separate the entries by seconds, it does not display them in the same order they are in the file.  So I guess it's really just a flaw/oversight in the way the CF Admin log display is written where it reads the file contents and then re-orders them arbitrarily rather than simply following the order provided by the file.  Guess I'll have to make my own log display template.