Skip to main content
Inspiring
February 4, 2025
Answered

Two Cold fusion servers, logging setting are same, but some errors are not logged on one of them

  • February 4, 2025
  • 2 replies
  • 1100 views

I noticed some errors ( for example, undefine varibles) are not logged on one of our coldfusion server. I have checked the settings, and I did not find any difference on the logging settings when i went to admin page. Because of the lack of logging, I have a hard time to debug our application. Can anyone help me? Thanks!

    Correct answer Charlie Arehart

    To be clear, there's no connection between the debugging ip address list and the writing of errors to the logs. There's also nothing that makes some errors in a given app get logged but not others (more on that in a moment).

     

    I appreciate you may be grasping at any possible straw. Here are some others to consider:

     

    1. When you get the error on  the server with "no logging", what do you se on screen? Anything? Nothing? A blue ball?
    2. Do you have a site-wide error handler defined in the cf admin's first settings page? What is its value, for both servers?  It may be that THAT error handler is intercepting errors and thus not causing them to be logged.
    3. Indeed, if you have ANY error handling (there, or at the app level--with onerror or cferror, or at the code level with try/catch), such error handling will prevent logging of an error....unless you choose to log it in the error handler itself, using cflog.

     

    Sometimes people relying solely on errors appearing in the log are caught out by such error handling which can prevent it.

     

    Please let us know if you confirm the above happening either way. 

    2 replies

    BKBK
    Community Expert
    Community Expert
    February 9, 2025

    @Enchanted_vibrancy5464 ,

    For discussion of the problem, more information is required.

    What are:

    • the ColdFusion version and update level?
    • the Operating System on which ColdFusion is running?
    • ColdFusion's installation directory?
    Inspiring
    February 15, 2025

    Our Coldfusion versions are 11.  Update Level 19. OS: Windows Server 2016. The directories of the in stallation are the same.

    One observation: the one where the logging is not working, but the debug information will print on the .cfm page after my IP is added on the "Debugging IP Address" on Administrator page. The one where the logging does works, but the debug information will not print on the screen; it always goes to the log file. 

     

    BKBK
    Community Expert
    Community Expert
    February 16, 2025

    ColdFusion 11 is quite old. So I no longer have access to it. However, I can give you 2 suggestions based on common solutions from recent versions of ColdFusion.

     

    After you implement each suggestion, do the following test to see whether the error is logged.

    <!---
    Store this line of code as the file loggingTest.cfm.
    Launch the file in a browser.
    Go to the ColdFusion logs directory.
    Examine application.log and coldfusion-out.log in a text editor.
    Do they contain the "Division by zero" error message?
     --->
     
    <cfset x=1/0>

     

    On the server where logging is not working:

    • Restart ColdFusion. That usually helps by resetting configurations, including those of logging.
      If that doesn't help, do the next. 
    • In the ColdFusion Administrator, go to the page Debugging & Logging > Logging Settings. Make sure that the input field Log directory contains the absolute path of the logs directory, for example, C:\ColdFusion11\YOUR_INSTANCENAME\logs.
      If you make any changes, click the button Submit Changes
    ccsimmons_FAVER
    Inspiring
    February 7, 2025
    If you have the ability to run CommandBox on the servers you can use the CLI to export the settings and then diff them for the most accurate comparison.

     

    Run on server 1 to export settings:

     

    cfconfig export to=C:\Path\to\server1\Config.json from=C:\ColdFusion2021\cfusion\ fromFormat=adobe@2021 excludeList=ACF11Password,ACF11RDSPassword,scheduledTasks,license,previousLicense

     

    Run on server 2 to export settings:

     

    cfconfig export to=C:\Path\to\server2\Config.json from=C:\ColdFusion2021\cfusion\ fromFormat=adobe@2021 excludeList=ACF11Password,ACF11RDSPassword,scheduledTasks,license,previousLicense

     

     

    Put the config files on the same machine and run:

     

    cfconfig diff from=C:\Path\to\server1\Config.json to=C:\Path\to\server2\Config.json PDFReportPath=C:\Path\to\report\diffs.pdf --ValuesDiffer

     

     

    You should have a nice comparison report of only the differences.

     

    Sources:
     
    Inspiring
    February 15, 2025

    Thanks for your help. I have tried this, the differences between the exported config: 

    1 the update site is https, and other one is http ( however, I go to the Administrator page, it is https on both servers).

    2 the datasources. This is understandable.

    I did not noticed any difference that affect the logging.