coldfusion - Coldfusion 有没有办法将所有错误发送到特定的电子邮件?

标签 coldfusion coldfusion-9

我有:

服务器详情
服务器产品 ColdFusion
版本 9,0,1,274733
版本标准
操作系统 Windows Server 2008
操作系统版本 6.0
Adobe 驱动程序版本 4.0(内部版本 0005)
我是否可以将 coldfusion 上发生的所有错误接收到特定电子邮件?

最佳答案

如果您不想向每个页面添加一个 cferror,您可以向您的 application.cfc 添加一个 onError 方法。只要任何页面出现错误,该函数就会被调用。

 <cffunction name="onError">
    <!--- The onError method gets two arguments:
    An exception structure, which is identical to a cfcatch variable.
    The name of the Application.cfc method, if any, in which the error
    happened. --->
    <cfargument name="Except" required="true"/>
    <cfargument type="String" name = "EventName" required="true"/>
     error handling goes here 
</cffunction>

我还看到您有一个问题,您担心邮件服务器无法正常工作。如果您担心您将无法收到关于您的错误的电子邮件,您可以将它们记录到一个文件中。

<!--- Log all errors in an application-specific log file. --->
<cflog file="filename" type="error" text="Event Name: #Eventname#" >
<cflog file="filename" type="error" text="Message: #except.message#">

关于coldfusion - Coldfusion 有没有办法将所有错误发送到特定的电子邮件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24317956/

相关文章:

caching - ColdFusion 的 cfquery 静默失败

coldfusion - 如何最好地创建和存储 APPLICATION 变量?

encryption - ColdFusion 中最安全的哈希算法是什么?

coldfusion - Application.cfm 未在 ColdFusion 应用程序中运行

java - Socket Programming -Java - 许多客户一个套接字问题

forms - CFForm 与 Coldfusion 中的 Form

xml - 遍历一个大的 XML 文件

java - ColdFusion 2016 Java ClassNotFoundException 异常

coldfusion - 如何扩展 Coldfusion 中的 32 位限制?

java - 服务器和 JRE 设置为 TLS 1.2,但 Coldfusion 9 仍尝试使用 TLS 1.0