Writing to eventlog from asp.net

A

Anders Both

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
help.

???
 
E

Earl Teigrob

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
logname="Application".
 
J

Joseph Hopkins

Hi,

The official way is:
http://support.microsoft.com/?id=329291

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).

Thanks,
Joseph Hopkins

Albany Software Ltd
 
A

Anders Both

Thx for the answers -

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

p.s. I don´t 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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top