tracker issue : CF-3846187

select a category, or use search below
(searches all categories and all time range)
Title:

[ANeff] Bug for: writeLog/cflog does not log application name when called within onApplicationEnd()

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Aaron Neff / Aaron Neff (Aaron Neff)

Created: 11/02/2014

Components: Logging

Versions: 11.0

Failure Type:

Found In Build/Fixed In Build: CF11_Final / CF11 Update5

Priority/Frequency: Minor / Very few users will encounter

Locale/System: English / Win All

Vote Count: 0

Listed in the version 11.0.05.293506 Issues Fixed doc
Repro:

<cfcomponent>
<cfscript>
  THIS.name = "myAppName";
  THIS.sessionManagement = true;
  THIS.applicationTimeout = createTimeSpan(0,0,0,10);
  THIS.sessionTimeout = createTimeSpan(0,0,0,5);
</cfscript>
<cffunction name="onApplicationStart">
  <cfset writeLog("onApplicationStart() was called [writeLog()]", "information", true, THIS.name) />
  <cflog text="onApplicationStart() was called [cflog]" type="information" application="true" file="#THIS.name#" />
  <cfreturn true>
</cffunction>
<cffunction name="onSessionStart">
  <cfset writeLog("onSessionStart() was called [writeLog()]", "information", true, THIS.name) />
  <cflog text="onSessionStart() was called [cflog]" type="information" application="true" file="#THIS.name#" />
</cffunction>
<cffunction name="onRequestStart">
  <cfset writeLog("onRequestStart() was called [writeLog()]", "information", true, THIS.name) />
  <cflog text="onRequestStart() was called [cflog]" type="information" application="true" file="#THIS.name#" />
  <cfreturn true>
</cffunction>
<cffunction name="onRequestEnd">
  <cfset writeLog("onRequestEnd() was called [writeLog()]", "information", true, THIS.name) />
  <cflog text="onRequestEnd() was called [cflog]" type="information" application="true" file="#THIS.name#" />/cffunction>
<cffunction name="onSessionEnd">
  <cfset writeLog("onSessionEnd() was called [writeLog()]", "information", true, THIS.name) />
  <cflog text="onSessionEnd() was called [cflog]" type="information" application="true" file="#THIS.name#" />
</cffunction>
<cffunction name="onApplicationEnd">
  <cfset writeLog("onApplicationEnd() was called [writeLog()]", "information", true, THIS.name) />
  <cflog text="onApplicationEnd() was called [cflog]" type="information" application="true" file="#THIS.name#" />
</cffunction>
</cfcomponent>

Actual Result: myAppName.log does not contain application name when writeLog()/cflog is called from within onApplicationEnd().

Expected Result: myAppName.log should contain application name when writeLog()/cflog is called from within onApplicationEnd().

Verified in 11.0.0.289822 and 11.0.03.291742.

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3846187

External Customer Info:
External Company:  
External Customer Name: itisdesign
External Customer Email:

Attachments:

Comments:

The fix for this bug is available in the pre-release build of ColdFusion 11 Update 5
Comment by CFwatson U.
10325 | February 20, 2015 09:27:24 AM GMT
Verified this is fixed in CF11 Update 5 (build 11,0,05,293506). Thanks very much!, -Aaron
Comment by External U.
10326 | May 15, 2015 05:51:33 PM GMT
Hi Adobe, There is still a slight inconsistency. If you run the code in the description and open myAppName.log, you will see something like this: ---------------------- "Severity","ThreadID","Date","Time","Application","Message" "Information","ajp-bio-8014-exec-1","11/15/15","08:01:03",,"C:\ColdFusion11\cfusion\logs\myAppName.log initialized" "Information","ajp-bio-8014-exec-1","11/15/15","08:01:03","MYAPPNAME","onApplicationStart() was called [writeLog()]" "Information","ajp-bio-8014-exec-1","11/15/15","08:01:03","MYAPPNAME","onApplicationStart() was called [cflog]" "Information","ajp-bio-8014-exec-1","11/15/15","08:01:03","MYAPPNAME","onSessionStart() was called [writeLog()]" "Information","ajp-bio-8014-exec-1","11/15/15","08:01:03","MYAPPNAME","onSessionStart() was called [cflog]" "Information","ajp-bio-8014-exec-1","11/15/15","08:01:03","MYAPPNAME","onRequestStart() was called [writeLog()]" "Information","ajp-bio-8014-exec-1","11/15/15","08:01:03","MYAPPNAME","onRequestStart() was called [cflog]" "Information","ajp-bio-8014-exec-1","11/15/15","08:01:03","MYAPPNAME","onRequestEnd() was called [writeLog()]" "Information","ajp-bio-8014-exec-1","11/15/15","08:01:03","MYAPPNAME","onRequestEnd() was called [cflog]" "Information","scheduler-0","11/15/15","08:01:15","MYAPPNAME","onSessionEnd() was called [writeLog()]" "Information","scheduler-0","11/15/15","08:01:15","MYAPPNAME","onSessionEnd() was called [cflog]" "Information","scheduler-1","11/15/15","08:01:30","myAppName","onApplicationEnd() was called [writeLog()]" "Information","scheduler-1","11/15/15","08:01:30","myAppName","onApplicationEnd() was called [cflog]" ---------------------- See how the application's name was logged as "myAppName" from onApplicationEnd() but "MYAPPNAME" from the rest? It should be consistent, so can it please also be UPPERCASEd from onApplicationEnd()? Thanks!, -Aaron
Comment by External U.
10327 | November 15, 2015 02:46:54 AM GMT
(Note: My code in the description has a typo.. the closing </cffunction> for onRequestEnd() is currently "/cffunction>". Sorry about that. When running the code, please just add the missing left angle bracket.)
Comment by External U.
10328 | November 15, 2015 02:49:41 AM GMT
I also see application name is also logged as "myAppName" (instead of "MYAPPNAME") from any Application.cfc method after applicationStop() is called. Interesting.
Comment by External U.
10329 | November 15, 2015 03:31:29 AM GMT