Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to log information from inside <CFScript>

I am learning to use <cfscript>.

Is there any way I can log some messages or values inside the <cfscript>?

like outside <cfscript> I can use <cflog>, Is there any way or Tag something like that, i can use to print the messages in log file inside >

Thanks

like image 284
CFUser Avatar asked Feb 10 '10 11:02

CFUser


2 Answers

ColdFusion 9 added the "writeLog" function which allows you to do this. http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WS48D04B65-0694-44e9-9E35-F9D7C9152B6C.html

like image 165
Terry Ryan Avatar answered Oct 23 '22 23:10

Terry Ryan


In Lucee/Railo you can use cflog in script by removing the angular brackets and the "cf" prefix, so you can write

<cfscript>
  log text="some text" file="logfilename" type="information";
</cfscript>

this is equivalent to

<cflog text="some text" file="logfilename" type="information">
like image 5
isapir Avatar answered Oct 24 '22 00:10

isapir