Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

Explorer ,
Feb 04, 2025 Feb 04, 2025

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!

445
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Feb 15, 2025 Feb 15, 2025

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 f
...
Translate
Explorer ,
Feb 07, 2025 Feb 07, 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:
 
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 15, 2025 Feb 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 09, 2025 Feb 09, 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?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 15, 2025 Feb 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. 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 15, 2025 Feb 15, 2025

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. 


/Charlie (troubleshooter, carehart. org)
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 16, 2025 Feb 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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 16, 2025 Feb 16, 2025

Thanks again.

I took your testing cfm file, it printed "An error occurred while executing the application. Please try again or contact the administrator."

After I added my IP to "Debugging IP Addresses", it printed more detail on my screen, and with

 Division by zero

I restarted Coldfusion 11 Application server, and the same thing. The log directory is correct.

 

I do see some message logging into 

coldfusion-out.txt, but no "Division by zero" anywhere in the log file or any log files in the log folder:

 

Feb 16, 2025 07:50:43 AM Information [scheduler-3] - Run Client Storage Purge

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 16, 2025 Feb 16, 2025
  • Please confirm that the file is called coldfusion-out.log, not coldfusion-out.txt.
  • What initially came to my mind has already been addressed by Charlie:
    (1) side-wide error handler (ColdFusion Administrator > Server Settings > Settings > Side-wide Error Handler), or
    (2) onError function in Application.cfc.

    Have you checked both of these?

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 16, 2025 Feb 16, 2025

Thank you so much for the help. Sorry, my bad: the log file is coldfusion-out.log. 

On the server where error logging did not work, I did see "/CFIDE/administrator/templates/secure_profile_error.cfm" in Server Settings->Settings->Site-wide Error Handler on the server the logging was not working. I compared with the other server where the logging works, and "Site-wide Error Handler" is empty, so I emptied that field too, and ran the testing page.  Wow, I see the error messsage logged in now.  Problem resolved!  this is a huge help for us. We are doing MS SQL migration for our Coldfusion projects, and we have a lot of issues to fix. The debugging& logging is really important for us to fix issue more effeciently. I am glad I join this Community.  Thank you everyone!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 16, 2025 Feb 16, 2025
LATEST

Great to hear, glad to have helped, and thanks for marking the answer for future readers.

 

BTW, to readers seeing this with the default threaded interface (especially on a phone, where it's lacking indentation), note that several messages that follow are from EARLIER, before their response and this one. 


/Charlie (troubleshooter, carehart. org)
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 16, 2025 Feb 16, 2025

Bkbk, the OP had said in their initial post that it was only SOME errors not being logged, and they had also confirmed that the logging settings were identical on the two servers--and that the cf instances were implemented in identical folders.

 

All these are why I took the discussion in the direction I did with my previous reply. 

 

Let's now hear what they say in reply to either of our suggestions. That should surely guide us to an ultimate resolution. (And FWIW I do have cf11 running if there's need for us to demonstrate/check anything there.)


/Charlie (troubleshooter, carehart. org)
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 16, 2025 Feb 16, 2025

Charlie, my last answer crossed yours on the wire. I hope it clarifies things.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 16, 2025 Feb 16, 2025

Yes. And indeed, I was writing my reply to you when in fact @Enchanted_vibrancy5464 was writing.

 

So thanks to them for that confirmation. Now let's hear if they may address what I'd offered. I really think it may still hold the answer to what's amiss, even given what they'd shared.

 

BTW, reading their reply on a phone was difficult because somehow the last part of their reply was in a code formatted paragraph...so it ran off to the right and couldn't be easily read (again, on a phone. Probably no big deal for those on a computer.)

 

Anyway, @Enchanted_vibrancy5464, I edited your post to correct that. It's something I only very rarely do, and only to correct such clearly unintended mistakes


/Charlie (troubleshooter, carehart. org)
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources