Copy link to clipboard
Copied
I've been tasked with finding out how other companies implement error logging. I'm not interested so much in how to use Coldfusion to log errors, I'm more interested in whether folks are using third party error logging tools.
What tools does your company use to manage application wide error logging?
Thanks in Advance
Copy link to clipboard
Copied
We use log4j which is incorporated within CF. Don't using CFLog as it is nothing more than a very limited shell on top of log4j. Research log4j and go through the documentation as it is very full featured. Hope this helps.
Copy link to clipboard
Copied
That's an Apache project right? We don't run Apache. I'm guessing I would have to configure Apache to enable this app to function?
Copy link to clipboard
Copied
Mike-
Don't confuse Apache Software Foundation (ASF) (the organization) with Apache HTTP Server (the web server, a specific product of the ASF). ASF has more than 150 top-level projects,including Apache HTTP Server, Apache Tomcat, Apache Lucene, Apache SOLR, and Apache log4j. They are completely separate and standalone products.
The problem is most people refer to Apache HTTP Server as just "Apache" (although 95% of the time people will know what you mean by the context).
-Carl V.
Copy link to clipboard
Copied
Got it. So, I've looked at the log4j documentation and scoured the net for info on how to implement what amounts to a custom implementation of log4j. There's lot's of 'examples' but nothing that shows me exactly what to do to log a message from a Coldfusion page. Everything I've seen is Java code.
What do I need to do or, where do I need to go to get log4j working?
Copy link to clipboard
Copied
mike_letson wrote:
Got it. So, I've looked at the log4j documentation and scoured the net for info on how to implement what amounts to a custom implementation of log4j. There's lot's of 'examples' but nothing that shows me exactly what to do to log a message from a Coldfusion page. Everything I've seen is Java code.
What do I need to do or, where do I need to go to get log4j working?
As Steve Sommers mentioned, Log4J is already built into ColdFusion. (I am assuming you are on a recent version of ColdFusion.) Loading an external log4J package on top of the in-built one might be too much of a good thing. Conflicts might arise.
Now, on to the good news. ColdFusion can fluently parler in Java. So you can just ask it to give you some of the log4J action.
For example, run the following in a CFM page, then check your ColdFusion logs:
<cfset log=createobject("java","org.apache.log4j.Logger").getLogger("arbitrarily_named_logger")>
<cfset log.warn('This is a custom warning generated at #now()#')>
<cfset log.error('This is a custom test error message generated at #now()#')>
Done logging.
Copy link to clipboard
Copied
Steve Sommers wrote:
We use log4j which is incorporated within CF. Don't using CFLog as it is nothing more than a very limited shell on top of log4j. Research log4j and go through the documentation as it is very full featured.
I agree with you that ColdFusion has only a limited implementation of Log4J. Nevertheless, it takes just what it needs from the log4J package.
Copy link to clipboard
Copied
I do find ColdFusion's own logging apparatus, including custom logging using, for example, <cflog>, sufficient for ColdFusion's needs. My bet is that the majority of ColdFusion Developers do as well.
Copy link to clipboard
Copied
thanks for your opinion ...