10 Replies Latest reply on Sep 11, 2013 4:37 AM by tribule

    Configuring logging in ColdFusion 10

    tribule Level 2

      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

        • 1. Re: Configuring logging in ColdFusion 10
          Adam Cameron. Level 5

          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

          • 2. Re: Configuring logging in ColdFusion 10
            tribule Level 2

            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

            • 3. Re: Configuring logging in ColdFusion 10
              Adam Cameron. Level 5

              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

              1 person found this helpful
              • 4. Re: Configuring logging in ColdFusion 10
                tribule Level 2

                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.

                • 5. Re: Configuring logging in ColdFusion 10
                  Adam Cameron. Level 5

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

                   

                  --

                  Adam

                  • 6. Re: Configuring logging in ColdFusion 10
                    tribule Level 2

                    Help appreciated Adam, it was worth a try.

                     

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

                    • 7. Re: Configuring logging in ColdFusion 10
                      tribule Level 2

                      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.

                      • 8. Re: Configuring logging in ColdFusion 10
                        Adam Cameron. Level 5

                        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

                        • 9. Re: Configuring logging in ColdFusion 10
                          tribule Level 2

                          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.

                          • 10. Re: Configuring logging in ColdFusion 10
                            tribule Level 2

                            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.

                            1 person found this helpful