Writing to eventlog from asp.net

Writing to eventlog from asp.net

Post by Anders Bot » Wed, 25 Feb 2004 06:58:29

How can i setup my system so that I can write into the eventLog from the
asp.net process.

I tryid to add the asp.net account to administrator group, but that does not


Writing to eventlog from asp.net

Post by Earl Teigr » Wed, 25 Feb 2004 07:18:57

I used the advice below to solve this issue


It most definetly is because of lack of rights. The ASPNET user on your
machine probably runs as userName="machine" (look for processmodel in
machine.config), which means that it is kept from harming your system.

The easy way to solve this is by setting this attribute to
userName="system". However by doing this the ASPNET user suddenly becomes
god on your machine and makes it vulnerable. Unfortunately I do not know of
a way to give the ASPNET user just enough right to create an event source,
and you're right about the info on the .NET. Everyone takes the easy way and
sets username="system".

Anyway, you can write til the "Application" event log by setting




Writing to eventlog from asp.net

Post by Joseph Hop » Wed, 25 Feb 2004 07:19:17


The official way is:

Another way (which is not recommended security wise) is to get the
machine.config from c:\<windir>\microsoft.net\framework\<version>\config
directory and change the processModel element to system. (which will get
your process to run in the old asp style (as privileged user).

Joseph Hopkins

Albany Software Ltd


Writing to eventlog from asp.net

Post by Anders Bot » Wed, 25 Feb 2004 07:35:13

Thx for the answers -

Now my only remaining problem is how i make my wery own "custom log", so
that I don need to write into the Application Log.

p.s. I don need asp.net to make the log. I can just make the new log from
a Windows application, and then write into it from asp.net.

Best Regards