473,569 Members | 2,406 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Write to event log

I am trying to write to the event log with the My.Log.WriteEnt ry("MyMessage" )

The call does nothing. I think that I need to set up the Listeners in the
config file. Is there any information on how to set up the listener for the
Application log and how to setup new logs for the app.

Thank you,

--
Jerry
Sep 7 '06 #1
4 1660
Hi Jerry,

What you needed is following MSDN article on this:

#How to: Write to an Application Event Log
http://msdn2.microsoft.com/en-us/library/07347hdt.aspx

I hope this helps. Please feel free to post here if anything is unclear.

Sincerely,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

Sep 7 '06 #2
Thank you for the reply.

I now get a error in the application event log.

The description for Event ID ( 0 ) in Source ( ContentDepot ) cannot be
found. The local computer may not have the necessary registry information or
message DLL files to display messages from a remote computer. You may be able
to use the /AUXSOURCE= flag to retrieve this description; see Help and
Support for details. The following information is part of the event: Test
Information Message.

I have asked this question before and did not understand the answers. This
is a plain install of windows server 2003 using Visual Studio 2005 and visual
basic for the development environment . The application is a asp.net
application running on IIS 6.0

The entries in the web.config are:

<system.diagnos tics>

<sources>
<!-- This section defines the logging configuration for
My.Application. Log -->
<source name="DefaultSo urce" switchName="Def aultSwitch">
<listeners>
<add name="EventLog"/>
</listeners>
</source>
</sources>
<switches>
<add name="DefaultSw itch" value="Informat ion" />
</switches>
<sharedListener s>
<add name="EventLog"
type="System.Di agnostics.Event LogTraceListene r, System, Version=2.0.0.0 ,
Culture=neutral , PublicKeyToken= b77a5c561934e08 9"
initializeData= "DDapp"/>
</sharedListeners >
</system.diagnost ics>
--
Jerry
"Walter Wang [MSFT]" wrote:
Hi Jerry,

What you needed is following MSDN article on this:

#How to: Write to an Application Event Log
http://msdn2.microsoft.com/en-us/library/07347hdt.aspx

I hope this helps. Please feel free to post here if anything is unclear.

Sincerely,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

Sep 7 '06 #3
Hi Jerry,

Thank you for your quick update.

I've reviewed your past post dated Aug. 11 about "Error Writing to Event
Log". In that post, your question is about writing event log from ASP.NET
web application.

I understand that you currently have created the event source in registry
HKEY_LOCAL_MACH INE\SYSTEM\Curr entControlSet\S ervices\Eventlo g\Application\D D
app which is required because by default the service account NETWORK
SERVICE running ASP.NET will not have the privilege to create it
automatically.

However, you need another registry value ErrorMessageFil e to fix the issue
you're seeing:

[HKEY_LOCAL_MACH INE\SYSTEM\Curr entControlSet\S ervices\Eventlo g\Application\D
Dapp]
"EventMessageFi le"="c:\\WINDOW S\\Microsoft.NE T\\Framework\\v 2.0.50727\\Even t
LogMessages.dll "

Change the path accordingly.

This is required by the Event Log system.

I hope this helps. Please feel free to post here if anything is unclear.

By the way, for ASP.NET related questions, I recommend you post in the
newsgroup microsoft.publi c.dotnet.framew ork.aspnet. Thank you.
Regards,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

Sep 8 '06 #4
Hi Jerry,

Have you tried my suggestion in my last post? Does it work for you? Please
post here if anything is unclear.

Regards,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

Sep 12 '06 #5

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

Similar topics

3
7938
by: Angelos Karantzalis | last post by:
Hi y'all, recently I've come across a situation where a web service needs to deal with an exception that might arise, originating from a COM+ component. It then returns an int value (please don't ask me why) indicating that there was something wrong with the requested operation. Assuming that I don't really know all the posible...
18
4866
by: jas | last post by:
Hi, I would like to start a new process and be able to read/write from/to it. I have tried things like... import subprocess as sp p = sp.Popen("cmd.exe", stdout=sp.PIPE) p.stdin.write("hostname\n") however, it doesn't seem to work. I think the cmd.exe is catching it.
8
6607
by: John | last post by:
Is there any special code I have to write to log event to Security Event Log? The following code give me "Very Easy Question, How to write log to SECURTY Event Log? Please help" Error // Create an EventLog instance and assign its source. EventLog myLog = new EventLog(); myLog.Source = "Security"; // Write an informational entry to the...
0
1504
by: sk.rasheedfarhan | last post by:
Hi all, According to my project requirement I have to write the NT Event information of SQL Server into EventLog viewer. For more clear I want to write the following information into Application log file: ------------------------------------------------------------------------------------------------------ Event ID :17055
3
18494
by: sk.rasheedfarhan | last post by:
Hi all, According to my project requirement I have to write the NT Event information of SQL Server into EventLog viewer. For more clear I want to write the following information into Application log file: ---------------------------------------------------------------------------­---------------------------
0
7703
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7618
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7926
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8132
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
5514
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
5222
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
3644
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2116
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
944
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.