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

Configuring logging in ColdFusion 10

Enthusiast ,
Aug 31, 2013 Aug 31, 2013

Copy link to clipboard

Copied

Hi,

Can someone please tell me how to configure the logging options in ColdFusion 10? In particular, we have a lot of WARN and INFO errors in our coldfusion-error.log and coldfusion-out.log files. These errors are not fixable, and we would rather not log them as they are not critical. The issue is that the logs grow massively and are not wanted.

How can we control the level of logging in ColdFusion 10? There is no information anywhere on this subject, either on the web generally or on Adobe's own website.

Advice appreciated.

Thanks,

Mark

Views

3.8K

Translate

Translate

Report

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
LEGEND ,
Aug 31, 2013 Aug 31, 2013

Copy link to clipboard

Copied

As far as I know you can't. IMO CF's logging is not very well thought out or implemented.


That said what is causing these INFO and WARNING entries to be logged in the first place?

--

Adam

Votes

Translate

Translate

Report

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
Enthusiast ,
Aug 31, 2013 Aug 31, 2013

Copy link to clipboard

Copied

Hi Adam,

Thanks for the reply. That is surprising, since one would think this is a basic requirement.

The errors are vague. We use a third-party ecommerce system (legacy) and we see:

[Fatal Error] :-1:-1: Premature end of file.

and:

WARN  org.xml.sax.SAXParseException; Premature end of file.

org.xml.sax.SAXParseException; Premature end of file.

errors in our logs. It does not affect our website, but the logs are enormous.

There is some mention of the subject of the SAX errors on the net, but not in context to our system.

Does anyone know how to stop these SAX errors? We have a saxpath.jar in use (dates from 2007).

Regards,

Mark

Votes

Translate

Translate

Report

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
LEGEND ,
Aug 31, 2013 Aug 31, 2013

Copy link to clipboard

Copied

I had a shufti around, and I found this config file: [instance]/lib/neo-logging.xml, and within that there is a setting value: <var name='priority'><string>information</string></var>. This does not have any equiv on the log-management UI in CFAdmin.  Maybe mess around with that and see if it helps... it might be a minimum log level to log? That's a guess.

--

Adam

Votes

Translate

Translate

Report

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
Enthusiast ,
Aug 31, 2013 Aug 31, 2013

Copy link to clipboard

Copied

Thanks for the heads up Adam, however I can't see how to isolate the log I need. If I add

<string>coldfusion-out.log</string>

Then the server will not start (error 500).

If I edit in a debug to replace information:

<var name='priority'><string>debug</string></var>

then I get a lot more debug-level errors from FusionReactor, but the SAX errors (Warn) are alas still there

Coldfusion-out.log will not be accepted as a log file in the neo-logging.xml file it seems.

Mark.

Votes

Translate

Translate

Report

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
LEGEND ,
Aug 31, 2013 Aug 31, 2013

Copy link to clipboard

Copied

No idea then, sorry mate. I truly suspect control of this sort of thing is not something that is exposed to the user.

--

Adam

Votes

Translate

Translate

Report

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
Enthusiast ,
Aug 31, 2013 Aug 31, 2013

Copy link to clipboard

Copied

Help appreciated Adam, it was worth a try.

Adobe - can you tell me why I cannot control my own log files?

Votes

Translate

Translate

Report

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
Enthusiast ,
Sep 01, 2013 Sep 01, 2013

Copy link to clipboard

Copied

A solution to the "org.xml.sax.SAXParseException; Premature end of file" exception is related to XML files, and in this case the non-existence of an XML file.

Our jurassic legacy code has a series of XML files for each ColdFusion template - these contain settings and other descriptive information about the template (all mostly irrelevant info). Some of the XML files were missing, and could not be loaded, hence the SAX error. The solution was to check if the necessary XML file was loaded, and if not, serve out a default instead. This cured the issue and the gigabytes of CF logs are now gone.

Votes

Translate

Translate

Report

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
LEGEND ,
Sep 01, 2013 Sep 01, 2013

Copy link to clipboard

Copied

Interesting. So it was your own code that was causing the log entries to be added to the log? How are you attempting to load the files? In my experience, CF is pretty bloody good at raising an explicit exception if it can't find a file that it's been asked to read.

--

Adam

Votes

Translate

Translate

Report

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
Enthusiast ,
Sep 01, 2013 Sep 01, 2013

Copy link to clipboard

Copied

Not my code personally, I have inherited an ancient system from 2005 all coded as Java classes. One bit of code loads the XML file and calls an init() method to process it. There are XML files for every CFM template, so I could just provide one for every template, but it's so long-winded and wasteful of resources.The CF exception mentioned that particular init() method and I did some further tests to see what XML file it was trying to load. Testing showed that the XML filename was missing on some requests, and so adding by a default XML file for these specific cases, it cured the problem. Now it will always find a default, and SAX is happy.

There was no CF exception that showed the missing XML file; that was what made it do difficult to debug. CF has so many logs and yet not one mentioned the missing file.

Votes

Translate

Translate

Report

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
Enthusiast ,
Sep 11, 2013 Sep 11, 2013

Copy link to clipboard

Copied

LATEST

I eventually found this file: \cfusion\runtime\conf\logging.properties. By setting org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level to WARN the plague of INFO errors has now gone. Hope this helps someone as CF10 (by default) seems to log copius amounts of INFO level events for cookies and other events.

Votes

Translate

Translate

Report

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
Documentation