473,397 Members | 2,084 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,397 software developers and data experts.

how to write to Applicaton log

Is the following the correct code to write to the Application EventLog :

EventLog appLog = new EventLog();

appLog.Source = String.Empty;

appLog.WriteEntry("my message");
Nov 17 '05 #1
6 1955
No it's not. You need to give a non-null non-empty value to the Source
property of your EventLog object.

"John Grandy" <johnagrandy-at-yahoo-dot-com> wrote in message
news:OL**************@TK2MSFTNGP11.phx.gbl...
Is the following the correct code to write to the Application EventLog :

EventLog appLog = new EventLog();

appLog.Source = String.Empty;

appLog.WriteEntry("my message");

Nov 17 '05 #2
Hi Francois, and thanks for the response.

Ok, I've figured out most of what I need to do from the documentation ...
except for how to specify the different types of log-entries: Information,
Warning and Error

EventLog does not seem to have an appropriate property.

"Francois Bonin [MVP]" <th*****@gmail.com> wrote in message
news:O2*************@TK2MSFTNGP10.phx.gbl...
No it's not. You need to give a non-null non-empty value to the Source
property of your EventLog object.

"John Grandy" <johnagrandy-at-yahoo-dot-com> wrote in message
news:OL**************@TK2MSFTNGP11.phx.gbl...
Is the following the correct code to write to the Application EventLog :

EventLog appLog = new EventLog();

appLog.Source = String.Empty;

appLog.WriteEntry("my message");


Nov 17 '05 #3
No it's not. You need to give a non-null non-empty value to the Source
property of your EventLog object.

"John Grandy" <johnagrandy-at-yahoo-dot-com> wrote in message
news:OL**************@TK2MSFTNGP11.phx.gbl...
Is the following the correct code to write to the Application EventLog :

EventLog appLog = new EventLog();

appLog.Source = String.Empty;

appLog.WriteEntry("my message");

Nov 17 '05 #4
Hi Francois, and thanks for the response.

Ok, I've figured out most of what I need to do from the documentation ...
except for how to specify the different types of log-entries: Information,
Warning and Error

EventLog does not seem to have an appropriate property.

"Francois Bonin [MVP]" <th*****@gmail.com> wrote in message
news:O2*************@TK2MSFTNGP10.phx.gbl...
No it's not. You need to give a non-null non-empty value to the Source
property of your EventLog object.

"John Grandy" <johnagrandy-at-yahoo-dot-com> wrote in message
news:OL**************@TK2MSFTNGP11.phx.gbl...
Is the following the correct code to write to the Application EventLog :

EventLog appLog = new EventLog();

appLog.Source = String.Empty;

appLog.WriteEntry("my message");


Nov 17 '05 #5
WriteEntry has an overload (as mentioned in the documentation):

appLog.WriteEntry("my message", EventLogEntryType.Warning);
"John Grandy" <johnagrandy-at-yahoo-dot-com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hi Francois, and thanks for the response.

Ok, I've figured out most of what I need to do from the documentation ...
except for how to specify the different types of log-entries: Information,
Warning and Error

EventLog does not seem to have an appropriate property.

"Francois Bonin [MVP]" <th*****@gmail.com> wrote in message
news:O2*************@TK2MSFTNGP10.phx.gbl...
No it's not. You need to give a non-null non-empty value to the Source
property of your EventLog object.

"John Grandy" <johnagrandy-at-yahoo-dot-com> wrote in message
news:OL**************@TK2MSFTNGP11.phx.gbl...
Is the following the correct code to write to the Application EventLog :

EventLog appLog = new EventLog();

appLog.Source = String.Empty;

appLog.WriteEntry("my message");



Nov 17 '05 #6
WriteEntry has an overload (as mentioned in the documentation):

appLog.WriteEntry("my message", EventLogEntryType.Warning);
"John Grandy" <johnagrandy-at-yahoo-dot-com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hi Francois, and thanks for the response.

Ok, I've figured out most of what I need to do from the documentation ...
except for how to specify the different types of log-entries: Information,
Warning and Error

EventLog does not seem to have an appropriate property.

"Francois Bonin [MVP]" <th*****@gmail.com> wrote in message
news:O2*************@TK2MSFTNGP10.phx.gbl...
No it's not. You need to give a non-null non-empty value to the Source
property of your EventLog object.

"John Grandy" <johnagrandy-at-yahoo-dot-com> wrote in message
news:OL**************@TK2MSFTNGP11.phx.gbl...
Is the following the correct code to write to the Application EventLog :

EventLog appLog = new EventLog();

appLog.Source = String.Empty;

appLog.WriteEntry("my message");



Nov 17 '05 #7

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

Similar topics

10
by: Greg Hurlman | last post by:
I've got what I'm sure is a very simple problem. In an ASP page, I am trying to write out 4 fields from a recordset in succession: Response.Write rs("LastName") Response.Write rs("Suffix")...
1
by: techy techno | last post by:
Hii Just wanted to know how can I decorate my texboxes and Listmenu which is called from a JS file using the following code below: document.write("<SELECT NAME='cur2' ONCHANGE='cconv1();'>");...
2
by: Brett Baisley | last post by:
Hello I have a block of html code that I want to run by calling a javascript function to print it. Its basically a table with menu items in it that is the same for many pages, and instead of...
0
by: hari krishna | last post by:
hi all, My requirement is to generate xl reports throu Asp.Net without installing xl on web server computer. i am using Response object and wrtifile method as below. i dont know whether it is...
8
by: Ben | last post by:
Hi all, Just wondering how to write (using document.write) to a table cell. I have table with 3 rows and 3 colums. I want to write from within the Javascript to say third column of a first row....
4
by: Prowler | last post by:
In the application we are currently building, we need to write positioning code on-the-fly, based upon the screen offset of the element in the AS/400 application which drives the Web app. The 400,...
0
by: John Grandy | last post by:
Is the following the correct code to write to the Application EventLog : EventLog appLog = new EventLog(); appLog.Source = String.Empty; appLog.WriteEntry("my message");
0
by: Imran | last post by:
Hi , I have an mdi applicaton. When user switch between child forms they are flickering like crazy! When a Child Form loads, you can see it in it's original size (the size from Design-time) then...
11
by: Vmusic | last post by:
Hi, I am trying to write out an array of string variables to Notepad. I can't get SendKeys to accept the string variable only literal quoted strings. I DO NOT want the hassle of writing to a...
4
by: cbtechlists | last post by:
I have an ASP app that we've moved from a Windows 2000 to a Windows 2003 server (sql server 2000 to sql server 2005). The job runs fine on the old servers. Part of the app takes a recordset and...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...
0
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...
0
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,...

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.