Code to Write an Error Event to the Commerce Server Event Log

This section describes how to write an error event to the event log.

The first parameter to the WriteErrorEvent method specifies, in this example, the name of the server in which Commerce Server 2002 is installed. The second parameter specifies the event message string.

Create the example ASP page using the following code:

<HTML>
<HEAD>
</HEAD>
<BODY>
<%
Dim oAdminEventLog
Set oAdminEventLog = Server.CreateObject("Commerce.AdminEventLog")
oAdminEventLog.Initialize("myServerName")
oAdminEventLog.WriteErrorEvent "mySite", "Error Event Message String"
%>
</BODY>
</HTML>

Copyright © 2005 Microsoft Corporation.
All rights reserved.