473,320 Members | 2,145 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Write to event log

I am trying to write to the event log with the My.Log.WriteEntry("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 1651
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.diagnostics>

<sources>
<!-- This section defines the logging configuration for
My.Application.Log -->
<source name="DefaultSource" switchName="DefaultSwitch">
<listeners>
<add name="EventLog"/>
</listeners>
</source>
</sources>
<switches>
<add name="DefaultSwitch" value="Information" />
</switches>
<sharedListeners>
<add name="EventLog"
type="System.Diagnostics.EventLogTraceListener, System, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089"
initializeData="DDapp"/>
</sharedListeners>
</system.diagnostics>
--
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_MACHINE\SYSTEM\CurrentControlSet\Servic es\Eventlog\Application\DD
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 ErrorMessageFile to fix the issue
you're seeing:

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servic es\Eventlog\Application\D
Dapp]
"EventMessageFile"="c:\\WINDOWS\\Microsoft.NET\\Fr amework\\v2.0.50727\\Event
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.public.dotnet.framework.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
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...
18
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)...
8
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...
0
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...
3
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.