473,587 Members | 2,548 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Event Logging from ASP.NET

In the past, I remember all kinds of security related issues when trying to
write to the event log but don't remember the specifics. Was there an issue
with creating a new source?

Can you write if you are using the ASP.NET account or Network Services
account? Did this change with .NET v2.0 and/or Win 2003 SP1?
thanks,

Jun 19 '07 #1
15 1515
Ysgrifennodd Andrew Robinson:
In the past, I remember all kinds of security related issues when trying
to write to the event log but don't remember the specifics. Was there an
issue with creating a new source?

Can you write if you are using the ASP.NET account or Network Services
account? Did this change with .NET v2.0 and/or Win 2003 SP1?
thanks,
Yes. My understanding is that you can write to a log that's been
created, but you can't create a new log.

We have a little Windows.Forms app that creates a log with a given name.
ASP.NET and Web service applications can then write to that log.
Whether or not this is the best solution, I have no idea, but it works
for us.

:-)
Peter
Jun 19 '07 #2
"Peter Bradley" <p.*******@dsl. pipex.comwrote in message
news:XM******** *************@p ipex.net...
Yes. My understanding is that you can write to a log that's been created,
but you can't create a new log.
That's also my understanding.. .
We have a little Windows.Forms app that creates a log with a given name.
ASP.NET and Web service applications can then write to that log. Whether
or not this is the best solution, I have no idea, but it works for us.
I have something similar...
--
http://www.markrae.net

Jun 19 '07 #3
The "issue" is still there. You can not create new source. But since you do
it only once simply have a desktop program that does it and run it under
Admin account.

Then your ASP.NET will be able to write into event log.

George

"Andrew Robinson" <ne****@nospam. nospamwrote in message
news:%2******** **********@TK2M SFTNGP03.phx.gb l...
In the past, I remember all kinds of security related issues when trying
to write to the event log but don't remember the specifics. Was there an
issue with creating a new source?

Can you write if you are using the ASP.NET account or Network Services
account? Did this change with .NET v2.0 and/or Win 2003 SP1?
thanks,

Jun 19 '07 #4
Are you getting paid for messages?

George

"Mark Rae" <ma**@markNOSPA Mrae.netwrote in message
news:uL******** ******@TK2MSFTN GP06.phx.gbl...
"Peter Bradley" <p.*******@dsl. pipex.comwrote in message
news:XM******** *************@p ipex.net...
>Yes. My understanding is that you can write to a log that's been
created, but you can't create a new log.

That's also my understanding.. .
>We have a little Windows.Forms app that creates a log with a given name.
ASP.NET and Web service applications can then write to that log. Whether
or not this is the best solution, I have no idea, but it works for us.

I have something similar...
--
http://www.markrae.net

Jun 19 '07 #5
Ok, if I can't create a new Source and I really don't want to require a user
to first run some type of desktop app, any suggestions on an existing source
that is likely to exist that I can use?

-Andy
"George Ter-Saakov" <gt****@cardone .comwrote in message
news:OZ******** ******@TK2MSFTN GP06.phx.gbl...
The "issue" is still there. You can not create new source. But since you
do it only once simply have a desktop program that does it and run it
under Admin account.

Then your ASP.NET will be able to write into event log.

George

"Andrew Robinson" <ne****@nospam. nospamwrote in message
news:%2******** **********@TK2M SFTNGP03.phx.gb l...
>In the past, I remember all kinds of security related issues when trying
to write to the event log but don't remember the specifics. Was there an
issue with creating a new source?

Can you write if you are using the ASP.NET account or Network Services
account? Did this change with .NET v2.0 and/or Win 2003 SP1?
thanks,

Jun 19 '07 #6
"George Ter-Saakov" <gt****@cardone .comwrote in message
news:eu******** ******@TK2MSFTN GP06.phx.gbl...
Are you getting paid for messages?
No more than you are for top-posting...
--
http://www.markrae.net

Jun 19 '07 #7
Not sure what type of solution you looking for.
New "source" is a simple entry in a registry.
You can
a) created manually
b) create using program that runs under Admin rights.
You choose.

Another option would be not to log into event log and intead send an email
with error info.
That is how all my online application work.

So usually i am there fixing bugs before user called me.

George.


"Andrew Robinson" <ne****@nospam. nospamwrote in message
news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
Ok, if I can't create a new Source and I really don't want to require a
user to first run some type of desktop app, any suggestions on an existing
source that is likely to exist that I can use?

-Andy
"George Ter-Saakov" <gt****@cardone .comwrote in message
news:OZ******** ******@TK2MSFTN GP06.phx.gbl...
>The "issue" is still there. You can not create new source. But since you
do it only once simply have a desktop program that does it and run it
under Admin account.

Then your ASP.NET will be able to write into event log.

George

"Andrew Robinson" <ne****@nospam. nospamwrote in message
news:%2******* ***********@TK2 MSFTNGP03.phx.g bl...
>>In the past, I remember all kinds of security related issues when trying
to write to the event log but don't remember the specifics. Was there an
issue with creating a new source?

Can you write if you are using the ASP.NET account or Network Services
account? Did this change with .NET v2.0 and/or Win 2003 SP1?
thanks,


Jun 19 '07 #8
re:
!any suggestions on an existing source that is likely to exist that I can use?

The Application Event Log is a good candidate.


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espańol : http://asp.net.do/foros/
=============== =============== ========
"Andrew Robinson" <ne****@nospam. nospamwrote in message
news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
Ok, if I can't create a new Source and I really don't want to require a user to first run some
type of desktop app, any suggestions on an existing source that is likely to exist that I can use?

-Andy
"George Ter-Saakov" <gt****@cardone .comwrote in message
news:OZ******** ******@TK2MSFTN GP06.phx.gbl...
>The "issue" is still there. You can not create new source. But since you do it only once simply
have a desktop program that does it and run it under Admin account.

Then your ASP.NET will be able to write into event log.

George

"Andrew Robinson" <ne****@nospam. nospamwrote in message
news:%2******* ***********@TK2 MSFTNGP03.phx.g bl...
>>In the past, I remember all kinds of security related issues when trying to write to the event
log but don't remember the specifics. Was there an issue with creating a new source?

Can you write if you are using the ASP.NET account or Network Services account? Did this change
with .NET v2.0 and/or Win 2003 SP1?
thanks,


Jun 19 '07 #9
I am afraid you a bit misleading the guy. "Applicatio n" Event Log is a name
of the log and not a source.
There are 2 components when writing into even log.

Source and Log Name.

Log Name identifies which event log. "Applicatio n", "System"... . You can
create your own name and it will be shown in the Even Viewer as a root node.

Then there is a Source of the event. Source basically points to which
application has created that entry in event log. You can see Source as a
column in the event viewer.

So folowing code
if (!EventLog.Sour ceExists("TEST" ))

EventLog.Create EventSource("TE ST", "Applicatio n");

EventLog.WriteE ntry("TEST", msg, EventLogEntryTy pe.Error);

will create even source TEST connected to event log "Applicatio n" and then
write there with source "TEST"

You need to have admin rights to create both new Log (usually "Applicatio n"
is used so no need to create it).
and new source.

George.


"Juan T. Llibre" <no***********@ nowhere.comwrot e in message
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
re:
!any suggestions on an existing source that is likely to exist that I
can use?

The Application Event Log is a good candidate.


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espańol : http://asp.net.do/foros/
=============== =============== ========
"Andrew Robinson" <ne****@nospam. nospamwrote in message
news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
>Ok, if I can't create a new Source and I really don't want to require a
user to first run some type of desktop app, any suggestions on an
existing source that is likely to exist that I can use?

-Andy
"George Ter-Saakov" <gt****@cardone .comwrote in message
news:OZ******* *******@TK2MSFT NGP06.phx.gbl.. .
>>The "issue" is still there. You can not create new source. But since you
do it only once simply have a desktop program that does it and run it
under Admin account.

Then your ASP.NET will be able to write into event log.

George

"Andrew Robinson" <ne****@nospam. nospamwrote in message
news:%2****** ************@TK 2MSFTNGP03.phx. gbl...
In the past, I remember all kinds of security related issues when
trying to write to the event log but don't remember the specifics. Was
there an issue with creating a new source?

Can you write if you are using the ASP.NET account or Network Services
account? Did this change with .NET v2.0 and/or Win 2003 SP1?
thanks,



Jun 19 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1501
by: ETL | last post by:
Hi, I think this question has an easy answer but I can't seem to find anything online that lists best practices for my problem. I have a C# app that uses an exception handling tree similar to the following. Try { blah blah blah....
3
1387
by: Sal Young | last post by:
I need help figuring out why the Application_Error event on my global.asax is not working. When I run my web application, I do get an error on the screen but no log file/record is created. Here is the code I have for the Application_Error in my global.asax: Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs) Dim...
29
15507
by: Patrick | last post by:
I have the following code, which regardless which works fine and logs to the EventViewer regardless of whether <processModel/> section of machine.config is set to username="SYSTEM" or "machine" ---Start of test.aspx---- <%@ Page language="C#" AutoEventWireup="false" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >...
0
1754
by: Tom Wingert | last post by:
Hi, I am having a problem with getting My.Log.WriteException to write to the Event Log in ASP.Net 2.0 with a web service. When an error occurs, My.Log.WriteException doesn't log anything to the Event Log. Played around with it and ended up adding the following listeners to catch and write to the event log by adding the following code in the...
5
6711
by: news.microsoft.com | last post by:
We are logging many events on our application but cant seem to discover how to determine who the user was in the session end event, as any session storage seems to have disapeared at the point at which the event fires. In essence, I want to log when a users session expires. Any inspiration would be appreciated.
0
4993
by: Eniac | last post by:
Hello, I've started using Enterprise Library 2.0 recently and I've encountered a problem that seems to be ... well... undocumented :) Basically, when I set a Trace Listener (formatted event log to be precise), if i specify the name of a custom event log, the listener won't log in it. I've checked in the registry, the log is there. In...
6
3393
by: JeffDotNet | last post by:
Writing to a registered source in the Application event log I have an asp.net framework 2.0 app that I created on a winxp machine and now I am deploying it to IIS6 on a win server2003 machine. This application has to write to the application event log. After deployment of the application I have verified that my source “MySource”...
0
4602
by: =?Utf-8?B?YW5rMmdv?= | last post by:
Hi, Thanks in advance for reading this. Not sure where to post this question, but I hope someone in here can help. Trying to write to Event Log in VS 2005 (.NET 2.0) using Enterprise Library 2.0 on a XP Pro SP2 Machine
10
1786
by: jaleel | last post by:
Hi , i would like to reopen the issue in the post http://www.gamedev.net/community/forums/topic.asp?topic_id=418791. My scenario is like this: 1. A web application is there (being created by some other company) 2. We develop the business layer and data access layer.
1
7973
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8220
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6626
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5718
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5394
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3844
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1454
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1189
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.