Not sure if you can do this directly from ASP (at least I don't know how).
You can however do this in a VB6 com object.
Check the App.LogEvent method that takes two parameters. First the error
message (mandatory) and then the optional eventType (1=Error, 2=Warning,
4=Information). App is a global object in VB defining information like
version etc.
App.LogEvent "Oops something went wrong..., 1
In your COM object you can define a public method that takes two input
parameters (message, and eventType). Then you instansiate this com object in
your ASP file and calls the public method with the message you want to write
and the eventType. Your public method then only calls the LogEvents method
on the App object using the input paramters message and eventType.
DaveF wrote:[color=blue]
> Is there a way to enter an error in the windows event application
> log. An example would be great[/color]
<%@Language="JS cript"%>
<%
var SUCCESS = 0;
var ERROR = 1;
var WARNING = 2;
var INFORMATION = 4;
var AUDIT_SUCCESS = 8;
var AUDIT_FAILURE = 16;
var objWScript = Server.CreateOb ject("WScript.S hell");
objWScript.LogE vent(INFORMATIO N, "UK Web programmer seeks job");
%>
--
Andrew Urquhart
- Reply: www.andrewu.co.uk/contact/
Comment