如何从<CFScript>内部记录信息

CFU*_*ser 15 coldfusion cfml lucee

我正在学习使用<cfscript>.

有什么办法可以记录< cfscript>?里面的一些消息或值吗?

像<cfscript>我可以使用的外部<cflog>,有没有任何方式或标记类似的东西,我可以用来打印日志文件里面的消息>

谢谢

isa*_*pir 5

在Lucee/Railo中,您可以通过删除尖括号和"cf"前缀在脚本中使用cflog,这样您就可以编写

<cfscript>
  log text="some text" file="logfilename" type="information";
</cfscript>
Run Code Online (Sandbox Code Playgroud)

这相当于

<cflog text="some text" file="logfilename" type="information">
Run Code Online (Sandbox Code Playgroud)