summaryrefslogtreecommitdiff
path: root/docs/log/evtvwr.aspx.html
blob: ab68664cd9758b0fd733f13280262b1dcd2b67cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head>





	<title>CodeProject: Getting the most out of Event Viewer. Free source code and programming help</title>
	
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="Description" content="This article talks about basics of event logging followed by the implementation details of how we can log messages effectively by using a custom log-file, event sources and event categories. Finally, it mentions the usefullness of troubleshooting links in error messages.; Author: Manoj G; Section: .NET Framework; Chapter: Platforms, Frameworks &amp; Libraries">
<meta name="Keywords" content=".NET 1.0, Win2K, VS.NET2002, VB, Dev, Intermediate,.NET Framework,Platforms, Frameworks &amp; Libraries,Free source code, tutorials">
<meta name="Author" content="The Code Project">
<meta name="Rating" content="General">
<meta name="Robots" content="index, follow">
<meta name="Revisit-After" content="1 days">
<link rel="alternate" type="application/rss+xml" title="CodeProject Latest articles - All topics" href="http://www.codeproject.com/webservices/articlerss.aspx?cat=1">
<link rel="alternate" type="application/rss+xml" title="CodeProject Latest articles - MFC / C++" href="http://www.codeproject.com/webservices/articlerss.aspx?cat=2">
<link rel="alternate" type="application/rss+xml" title="CodeProject Latest articles - C#" href="http://www.codeproject.com/webservices/articlerss.aspx?cat=3">
<link rel="alternate" type="application/rss+xml" title="CodeProject Latest articles - ASP.NET" href="http://www.codeproject.com/webservices/articlerss.aspx?cat=4">
<link rel="alternate" type="application/rss+xml" title="CodeProject Latest articles - .NET" href="http://www.codeproject.com/webservices/articlerss.aspx?cat=5">
<link rel="alternate" type="application/rss+xml" title="CodeProject Latest articles - VB.NET" href="http://www.codeproject.com/webservices/articlerss.aspx?cat=6">
<link rel="alternate" type="application/rss+xml" title="CodeProject Lounge Postings" href="http://www.codeproject.com/webservices/LoungeRSS.aspx">
<link rel="search" type="application/opensearchdescription+xml" title="CodeProject" href="http://www.codeproject.com/info/OpenSearch.xml">
	<!-- base -->
	
<script type="text/javascript">
  var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
  document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script><script src="evtvwr.aspx_files/ga.js" type="text/javascript"></script>
<script type="text/javascript">
   var pageTracker = _gat._getTracker("UA-1735123-1");
   pageTracker._setDomainName("www.codeproject.com");
   pageTracker._setSessionTimeout("1200"); // 20 mins
   pageTracker._initData();
   pageTracker._trackPageview();
</script>
	
	<script type="text/javascript" language="Javascript">//<![CDATA[
if(top!=self)top.location.href=location.href; if(typeof(DemoUrl)!="undefined")document.write(unescape('%3Cme')+'ta http'+'-equiv="re' +'fresh" con'+'tent="1;url='+DemoUrl+unescape('"%3CE'));
//]]></script>

<script type="text/javascript" language="Javascript" src="evtvwr.aspx_files/oncopy.js"></script>
<script type="text/javascript" language="Javascript" src="evtvwr.aspx_files/JobsSummaryRetriever.js"></script>
<script type="text/javascript" language="Javascript" src="evtvwr.aspx_files/jquery-1.js"></script>
<script type="text/javascript" language="Javascript" src="evtvwr.aspx_files/addto.js"></script>
<script type="text/javascript" language="Javascript">//<![CDATA[
function ToggleMenu(itemName)
{
	var elm = document.getElementById(itemName);
	var i,others = document.getElementById('SectionMenu');
	for(i=0; i < others.childNodes.length; i++)
	{
		var other = others.childNodes[i];
		if ((other.className == 'MenuSectionBlock') && (other != elm))
			other.style.display='none';
	}
	if (elm.style.display == 'block') elm.style.display='none';
	else elm.style.display='block';
	return false;
}

//]]></script>

<script type="text/javascript" language="Javascript" src="evtvwr.aspx_files/rateitem.js"></script>
<script type="text/javascript" language="Javascript">//<![CDATA[
function ChkRt(val) { if (val<=2) {$('#RateComDiv').css("display","");}else $('#RateComDiv').css("display","none");}
//]]></script>

<script type="text/javascript" language="Javascript">//<![CDATA[
var Selected = "-1";

function SwitchMessage(e, msgId)
{
  if (!msgId) {
    if(!e)e=window.event;
    var target=e.target?e.target:e.srcElement;
    while(target&&target.id!='DynMessLink')target=target.parentNode;
    if(!target||target.id!='DynMessLink')return;
    msgId=target.name;
  }
  if(Selected&&Selected!=""){
    var body=eval("document.getElementById('F" + Selected + "_h1')");
    if(body) body.style.display = 'none';
    var head=eval("document.getElementById('F" + Selected + "_h0')");
    if(head) head.className = head.className.replace("Sel", "UnSel");
  }
  if(Selected==msgId.toString())
    Selected="";
  else {
    Selected=msgId.toString();
    var body=eval("document.getElementById('F" + Selected + "_h1')");
    if(body){
      if(body.style.display=='none') body.style.display='';
      else body.style.display = 'none';
    }
    var head=eval("document.getElementById('F" + Selected + "_h0')");
    if (head) 
      head.className = head.className.replace("UnSel", "Sel");
    if(body&&head&&body.style.display!='none'){
      document.body.scrollTop = getRealPos(head, "Top") - document.body.clientHeight/10;
      EnsureMessageVisible(Selected, true);
    }
  }
  if (e){if(e.preventDefault)e.preventDefault;else e.returnValue=false;}
  return false;
}

//]]></script>

<script type="text/javascript" language="Javascript" src="evtvwr.aspx_files/ShortCuts.js"></script>
<link type="text/css" rel="stylesheet" href="evtvwr.aspx_files/CodeProject.css">
<link type="text/css" rel="stylesheet" href="evtvwr.aspx_files/ForumClassic.css">
<link type="text/css" rel="stylesheet" href="evtvwr.aspx_files/navmenu.css">
<link rel="icon" href="http://www.codeproject.com/favicon.ico" type="image/ico">
<link rel="shortcut icon" href="http://www.codeproject.com/favicon.ico" type="image/ico">

</head><body>

<a href="#Main"><img alt="Click here to Skip to main content" src="evtvwr.aspx_files/t.gif" style="border-style: none; position: absolute; top: 0pt; left: 0pt; width: 1px; height: 1px; z-index: 100;"></a>

<div style="margin: 0px; padding: 0px; width: 100%;">
	<div style="width: 100%;">

<table class="MemberNavBar" width="100%" cellpadding="5" cellspacing="0">
<tbody><tr>
<td style="font-weight: bold;">5,950,814 members and growing! (16,922 online)</td>
<td align="right">



<div id="ctl00_MemberMenu_LoggedOffOptions" class="MemberNavBarText" style="margin: 0pt; padding: 0pt;">
	<a name="SignUp"></a>
<form name="subForm" id="subForm" action="/script/Membership/LogOn.aspx?rp=%2fKB%2fdotnet%2fevtvwr.aspx" method="post" style="margin: 0pt; padding: 0pt;">
Email    <input class="SmallText" name="Email" id="Email" style="width: 100px;" type="text">
Password <input class="SmallText" name="Password" id="Password" style="width: 60px;" type="password">
<input value="Sign in" class="FormButton" type="submit">
<script type="text/javascript">
function Join(){document.location.href='/script/Membership/Modify.aspx';return false;}
document.write('<input type="button" class="FormButton" onclick="return Join();" value="Join"');
document.write('<input type="hidden" name="fld_quicksign" value="true" />');
</script><input class="FormButton" onclick="return Join();" value="Join" type="button"><input name="fld_quicksign" value="true" type="hidden">
<input checked="checked" name="cookie" id="RememberMeCheck" type="checkbox">
<label for="RememberMeCheck">Remember me?</label>&nbsp;
<a id="ctl00_MemberMenu_SendPassword" href="http://www.codeproject.com/script/Membership/SendPassword.aspx?rp=%2fKB%2fdotnet%2fevtvwr.aspx"><img alt="help" src="evtvwr.aspx_files/help.gif" width="16" align="middle" border="0" height="16">Lost your password?</a>
</form>

</div>

</td>
</tr>
</tbody></table></div>
	<table width="100%" border="0" cellpadding="0" cellspacing="0"><tbody><tr>
		<td class="HeaderLogo"><a href="http://www.codeproject.com/"><img id="ctl00_Logo" src="evtvwr.aspx_files/logo225x90.gif" alt="The Code Project" style="border-width: 0px; height: 90px; width: 225px;"></a></td>				 
		<td class="HeaderBanner" width="100%" align="right"><script type="text/javascript">document.write(unescape("%3ca%20href%3d%22http%3a%2f%2fwww.codeproject.com%2fRedir.aspx%3fadid%3d9401%26way%3dban%22%20target%3d%22_blank%22%20rel%3d%22nofollow%22%3e%3cimg%20src%3d%22http%3a%2f%2fwww.codeproject.com%2fscript%2fAdm%2fServeImg.aspx%3fFile%3d%252fscript%252fAdm%252fimages%252fSoftLayer_Mar2-Mar-8_728x90.gif%26C%3dFalse%26adid%3d9401%22%20alt%3d%22%22%20border%3d%220%22%20width%3d%22728%22%20height%3d%2290%22%3e%3c%2fa%3e"));</script><a href="http://www.codeproject.com/Redir.aspx?adid=9401&amp;way=ban" target="_blank" rel="nofollow"><img src="evtvwr.aspx_files/ServeImg.html" alt="" width="728" border="0" height="90"></a></td>
	</tr></tbody></table>
	






<div class="NavBarMain">
<ul id="nav">
<li><a href="http://www.codeproject.com/">Home</a></li>
<li><a class="down" href="http://www.codeproject.com/script/articles/latest.aspx">Articles</a>

	<ul class="flyout">
		<li><a class="fly" href="http://www.codeproject.com/script/articles/latest.aspx">Latest</a></li>
		<li><a class="fly" href="http://www.codeproject.com/info/search.aspx">Search</a></li>		
		<li><a class="fly" href="http://www.codeproject.com/script/articles/TopArticles.aspx">Most Popular</a></li>	
		<li><a class="fly" href="http://www.codeproject.com/info/search.aspx?vidlst=152&amp;sa_us=True">Beginner Articles</a></li>
		
		<li><a class="fly" href="http://www.codeproject.com/script/Content/SiteMap.aspx">Topic List</a></li>
		<li><a class="fly" href="http://www.codeproject.com/info/submit.aspx">Submit an Article</a></li>
		<li><a class="fly" href="http://www.codeproject.com/info/submit.aspx#Update">Update an Article</a></li>
		<li><a class="last" href="http://www.codeproject.com/script/awards/CurrentCompetitions.aspx">Article Competition</a></li>
	</ul>
	
</li>
<li><a class="down" href="http://www.codeproject.com/script/Forums/List.aspx">Message Boards</a>

	<ul class="flyout">
		<li><a class="fly" href="http://www.codeproject.com/script/Forums/View.aspx?fid=12076">ASP.NET</a></li>
		<li><a class="fly" href="http://www.codeproject.com/script/Forums/View.aspx?fid=4486">ATL / WTL / STL</a></li>
		<li><a class="fly" href="http://www.codeproject.com/script/Forums/View.aspx?fid=1647">C++ / MFC</a></li>
		<li><a class="fly" href="http://www.codeproject.com/script/Forums/View.aspx?fid=3785">(Managed) C++/CLI</a></li>
		<li><a class="fly" href="http://www.codeproject.com/script/Forums/View.aspx?fid=1649">C#</a></li>
		<li><a class="fly" href="http://www.codeproject.com/script/Forums/View.aspx?fid=1648">COM</a></li>
		<li><a class="fly" href="http://www.codeproject.com/script/Forums/View.aspx?fid=186301">Hardware</a></li>
		<li><a class="fly" href="http://www.codeproject.com/script/Forums/View.aspx?fid=1004117">LINQ and .NET 3.5</a></li>
		<li><a class="fly" href="http://www.codeproject.com/script/Forums/View.aspx?fid=1650">.NET Framework</a></li>
		<li><a class="fly" href="http://www.codeproject.com/script/Forums/View.aspx?fid=1644">OS / SysAdmin</a></li>
		<li><a class="fly" href="http://www.codeproject.com/script/Forums/View.aspx?fid=1004257">Silverlight</a></li>
		<li><a class="fly" href="http://www.codeproject.com/script/Forums/View.aspx?fid=1725">General Database</a></li>
		<li><a class="fly" href="http://www.codeproject.com/script/Forums/View.aspx?fid=1646">VB.NET</a></li>
		<li><a class="fly" href="http://www.codeproject.com/script/Forums/View.aspx?fid=1640">Web Development</a></li>
		<li><a class="fly" href="http://www.codeproject.com/script/Forums/View.aspx?fid=1004114">WPF / WCF / WF</a></li>
		<li><a class="fly" href="http://www.codeproject.com/script/Forums/View.aspx?fid=3421">XML / XSL</a></li>
		<li><a class="fly" href="http://www.codeproject.com/script/Forums/View.aspx?fid=1642">General Discussions</a></li>
		<li><a class="fly" href="http://www.codeproject.com/script/Forums/View.aspx?fid=1645">Suggestions / Site Bugs</a></li>
		
		<li><a class="last" href="http://www.codeproject.com/script/Forums/List.aspx">All Message Boards...</a></li>
	</ul>
	
</li>

<li><a href="http://www.codeproject.com/script/Jobs/">Job Board</a></li>


<li><a href="http://www.codeproject.com/script/Catalog/">Component Catalog</a></li>


<li><a href="http://www.codeproject.com/info/faq.aspx">Help!</a>

	<ul class="flyout">
		<li><a class="fly" href="http://www.codeproject.com/info/Guide.aspx">What is 'The Code Project'?</a></li>
		<li><a class="fly" href="http://www.codeproject.com/info/faq.aspx">General FAQ</a></li>
		<li><a class="fly" href="http://www.codeproject.com/script/Forums/List.aspx">Post a Question</a></li>
		<li><a class="fly" href="http://www.codeproject.com/script/Content/SiteMap.aspx">Site Directory</a></li>
		<li><a class="last" href="http://www.codeproject.com/info/about.aspx">About Us</a></li>
	</ul>

</li>

<li style="float: right;"><a href="http://www.codeproject.com/Lounge.aspx">Lounge</a></li>
</ul>

</div>


	<div style="width: 100%;"><a name="_top"></a><table id="ctl00_ArticleTopHeader_HeaderTable" class="ArticleHeader" width="100%" cellpadding="3">
	<tbody><tr valign="top">
		<td class="SmallText">
	<a id="ctl00_ArticleTopHeader_ChapterLink" href="http://www.codeproject.com/script/Content/Chapter.aspx?chptId=8">Platforms, Frameworks &amp; Libraries</a> »
	<a id="ctl00_ArticleTopHeader_SectionLink" href="http://www.codeproject.com/KB/dotnet/">.NET Framework</a> »
	<a id="ctl00_ArticleTopHeader_SubsectionLink" href="http://www.codeproject.com/KB/dotnet/index.aspx?#.NET%20Framework%20-%20General">General</a>
	<span id="ctl00_ArticleTopHeader_SkillLevel" class="ArticleIntermediate">&nbsp;&nbsp;&nbsp; Intermediate</span> 
	<span id="ctl00_ArticleTopHeader_LicenceTerms"></span>
	<br><br>
	<h1><span id="ctl00_ArticleTopHeader_ArticleTitle" class="ArticleTopTitle">Getting the most out of Event Viewer</span></h1>
	<b>By <a href="http://www.codeproject.com/script/Articles/MemberArticles.aspx?amid=144339">Manoj G</a></b><br>
	
	<br>
    <span id="ctl00_ArticleTopHeader_ArticleDescr">This
article talks about basics of event logging followed by the
implementation details of how we can log messages effectively by using
a custom log-file, event sources and event categories. Finally, it
mentions the usefullness of troubleshooting links in error messages.</span>
</td>
		<td style="width: 210px;">
	<span id="ctl00_ArticleTopHeader_ArticleAttributes" class="SmallText">VB.NET 1.0, Win2K, Windows, .NETVisual Studio, VS.NET2002, Dev</span>
	<table style="margin: 8px 0pt 0pt; padding: 0pt;" class="SmallText">
	
	<tbody><tr><td>Posted:</td><td><b>17 May 2003</b></td></tr>
	
	<tr><td>Views:</td><td><b>156,165</b></td></tr>
	
	<tr><td>Bookmarked:</td><td><b>69 times</b></td></tr>
	
	
	
	
	</tbody></table>
</td>
	</tr>
</tbody></table>

	</div>
</div>

<div>

<div id="ctl00_LHNavBar" class="LHNavBar">

	

<div class="FeatureBlockHeader" style="border-style: none; margin-top: 5px;">Announcements</div>
<div class="FeatureBlockContent" style="border-style: none; padding: 0pt; margin-bottom: 5px;">
<table cellpadding="2">








<tbody><tr valign="middle"><td><img src="evtvwr.aspx_files/javaduke.jpg" alt="Comp" width="24" height="24"></td>
<td><a href="http://www.codeproject.com/Contests/Java/">Java Competition</a></td></tr>



<tr valign="middle"><td><img src="evtvwr.aspx_files/smartclient24.jpg" alt="Comp" width="24" align="middle" height="24"></td>
<td><a href="http://www.codeproject.com/Contests/SmartClient/">Smart Client Comp</a></td></tr>



<tr valign="middle"><td><img src="evtvwr.aspx_files/LAMP.GIF" alt="Comp" width="24" align="middle" height="24"></td>
<td><a href="http://www.codeproject.com/Contests/LAMP/">LAMP drag-bike comp</a></td></tr>



<tr valign="middle"><td><img src="evtvwr.aspx_files/MonthlyComp.png" alt="Comp" width="24" align="middle" height="24"></td>
<td><a id="ctl00_Announcements_CompLink" href="http://www.codeproject.com/Feature/ArticleCompetition/">Monthly Competition</a></td></tr>
</tbody></table>
</div>
		
	
<div id="Th">

<div class="FeatureBlockHeader" style="margin-top: 7px;">Want a new Job?</div>
<div class="FeatureBlockContent">


<ul class="InfoList">

		<li>
		<a id="RelatedJobs_RC_ctl00_Lnk" href="http://www.codeproject.com/script/Jobs/View.aspx?jid=559">Application Developer</a>
		 at EZ-Filing, Inc.
		 in United States
		</li>		
	
		<li>
		<a id="RelatedJobs_RC_ctl01_Lnk" href="http://www.codeproject.com/script/Jobs/View.aspx?jid=539">C# Developer with maths skills</a>
		 at SMT
		 in United Kingdom
		</li>		
	
		<li>
		<a id="RelatedJobs_RC_ctl02_Lnk" href="http://www.codeproject.com/script/Jobs/View.aspx?jid=567">Intermediate &amp; Senior .NET Software Engineers</a>
		 at INTEQNA
		 in Canada
		</li>		
	
<li>
	<a id="RelatedJobs_LJ" href="http://www.codeproject.com/script/Jobs/List.aspx">View Latest Jobs...</a>
</li>
</ul>

</div>
</div>

	
	
	<div id="SectionMenu">
<div class="MenuCat">Chapters</div>
<div class="MenuChapter"><a href="http://www.codeproject.com/script/Content/Chapter.aspx?chptId=1" onclick="return ToggleMenu('Chapter1');">Desktop Development</a></div>
<div class="MenuSectionBlock" id="Chapter1" style="display: none;">
<div class="MI" id="Section1"><a href="http://www.codeproject.com/KB/buttons/">Button Controls</a></div>
<div class="MI" id="Section15"><a href="http://www.codeproject.com/KB/clipboard/">Clipboard</a></div>
<div class="MI" id="Section2"><a href="http://www.codeproject.com/KB/combobox/">Combo &amp; List Boxes</a></div>
<div class="MI" id="Section67"><a href="http://www.codeproject.com/KB/dialog/">Dialogs and Windows</a></div>
<div class="MI" id="Section107"><a href="http://www.codeproject.com/KB/gadgets/">Desktop Gadgets</a></div>
<div class="MI" id="Section16"><a href="http://www.codeproject.com/KB/docview/">Document / View</a></div>
<div class="MI" id="Section4"><a href="http://www.codeproject.com/KB/edit/">Edit Controls</a></div>
<div class="MI" id="Section17"><a href="http://www.codeproject.com/KB/files/">Files and Folders</a></div>
<div class="MI" id="Section3"><a href="http://www.codeproject.com/KB/grid/">Grid &amp; Data Controls</a></div>
<div class="MI" id="Section5"><a href="http://www.codeproject.com/KB/list/">List Controls</a></div>
<div class="MI" id="Section6"><a href="http://www.codeproject.com/KB/menus/">Menus</a></div>
<div class="MI" id="Section14"><a href="http://www.codeproject.com/KB/miscctrl/">Miscellaneous</a></div>
<div class="MI" id="Section18"><a href="http://www.codeproject.com/KB/printing/">Printing</a></div>
<div class="MI" id="Section95"><a href="http://www.codeproject.com/KB/progress/">Progress Controls</a></div>
<div class="MI" id="Section11"><a href="http://www.codeproject.com/KB/selection/">Selection Controls</a></div>
<div class="MI" id="Section19"><a href="http://www.codeproject.com/KB/shell/">Shell and IE programming</a></div>
<div class="MI" id="Section68"><a href="http://www.codeproject.com/KB/smart/">Smart Client</a></div>
<div class="MI" id="Section8"><a href="http://www.codeproject.com/KB/splitter/">Splitter Windows</a></div>
<div class="MI" id="Section9"><a href="http://www.codeproject.com/KB/static/">Static &amp; Panel Controls</a></div>
<div class="MI" id="Section10"><a href="http://www.codeproject.com/KB/statusbar/">Status Bar</a></div>
<div class="MI" id="Section7"><a href="http://www.codeproject.com/KB/tabs/">Tabs &amp; Property Pages</a></div>
<div class="MI" id="Section12"><a href="http://www.codeproject.com/KB/toolbars/">Toolbars &amp; Docking windows</a></div>
<div class="MI" id="Section13"><a href="http://www.codeproject.com/KB/tree/">Tree Controls</a></div>
</div>
<div class="MenuChapter"><a href="http://www.codeproject.com/script/Content/Chapter.aspx?chptId=2" onclick="return ToggleMenu('Chapter2');">Web Development</a></div>
<div class="MenuSectionBlock" id="Chapter2" style="display: none;">
<div class="MI" id="Section70"><a href="http://www.codeproject.com/KB/ajax/">Ajax and Atlas</a></div>
<div class="MI" id="Section27"><a href="http://www.codeproject.com/KB/applications/">Applications &amp; Tools</a></div>
<div class="MI" id="Section85"><a href="http://www.codeproject.com/KB/asp/">ASP</a></div>
<div class="MI" id="Section89"><a href="http://www.codeproject.com/KB/aspnet/">ASP.NET</a></div>
<div class="MI" id="Section28"><a href="http://www.codeproject.com/KB/webforms/">ASP.NET Controls</a></div>
<div class="MI" id="Section38"><a href="http://www.codeproject.com/KB/ATL-Server/">ATL Server</a></div>
<div class="MI" id="Section29"><a href="http://www.codeproject.com/KB/web-cache/">Caching</a></div>
<div class="MI" id="Section91"><a href="http://www.codeproject.com/KB/web-image/">Charts, Graphs and Images</a></div>
<div class="MI" id="Section25"><a href="http://www.codeproject.com/KB/scripting/">Client side scripting</a></div>
<div class="MI" id="Section30"><a href="http://www.codeproject.com/KB/custom-controls/">Custom Controls</a></div>
<div class="MI" id="Section23"><a href="http://www.codeproject.com/KB/HTML/">HTML / CSS</a></div>
<div class="MI" id="Section24"><a href="http://www.codeproject.com/KB/ISAPI/">ISAPI</a></div>
<div class="MI" id="Section33"><a href="http://www.codeproject.com/KB/server-management/">Site &amp; Server Management</a></div>
<div class="MI" id="Section34"><a href="http://www.codeproject.com/KB/session/">Session State</a></div>
<div class="MI" id="Section113"><a href="http://www.codeproject.com/KB/silverlight/">Silverlight</a></div>
<div class="MI" id="Section36"><a href="http://www.codeproject.com/KB/trace/">Trace and Logs</a></div>
<div class="MI" id="Section31"><a href="http://www.codeproject.com/KB/user-controls/">User Controls</a></div>
<div class="MI" id="Section37"><a href="http://www.codeproject.com/KB/validation/">Validation</a></div>
<div class="MI" id="Section35"><a href="http://www.codeproject.com/KB/viewstate/">View State</a></div>
<div class="MI" id="Section26"><a href="http://www.codeproject.com/KB/WAP/">WAP / WML</a></div>
<div class="MI" id="Section32"><a href="http://www.codeproject.com/KB/web-security/">Web Security</a></div>
<div class="MI" id="Section20"><a href="http://www.codeproject.com/KB/webservices/">Web Services</a></div>
</div>
<div class="MenuChapter"><a href="http://www.codeproject.com/script/Content/Chapter.aspx?chptId=9" onclick="return ToggleMenu('Chapter9');">Enterprise Systems</a></div>
<div class="MenuSectionBlock" id="Chapter9" style="display: none;">
<div class="MI" id="Section98"><a href="http://www.codeproject.com/KB/MCMS/">Content Management Server</a></div>
<div class="MI" id="Section99"><a href="http://www.codeproject.com/KB/biztalk/">Microsoft BizTalk Server</a></div>
<div class="MI" id="Section102"><a href="http://www.codeproject.com/KB/exchange/">Microsoft Exchange</a></div>
<div class="MI" id="Section90"><a href="http://www.codeproject.com/KB/office/">Office Development</a></div>
<div class="MI" id="Section101"><a href="http://www.codeproject.com/KB/sharepoint/">SharePoint Server</a></div>
</div>
<div class="MenuChapter"><a href="http://www.codeproject.com/script/Content/Chapter.aspx?chptId=3" onclick="return ToggleMenu('Chapter3');">Multimedia</a></div>
<div class="MenuSectionBlock" id="Chapter3" style="display: none;">
<div class="MI" id="Section42"><a href="http://www.codeproject.com/KB/audio-video/">Audio and Video</a></div>
<div class="MI" id="Section44"><a href="http://www.codeproject.com/KB/directx/">DirectX</a></div>
<div class="MI" id="Section46"><a href="http://www.codeproject.com/KB/GDI/">GDI</a></div>
<div class="MI" id="Section47"><a href="http://www.codeproject.com/KB/GDI-plus/">GDI+</a></div>
<div class="MI" id="Section43"><a href="http://www.codeproject.com/KB/graphics/">General Graphics</a></div>
<div class="MI" id="Section45"><a href="http://www.codeproject.com/KB/openGL/">OpenGL</a></div>
</div>
<div class="MenuChapter"><a href="http://www.codeproject.com/script/Content/Chapter.aspx?chptId=4" onclick="return ToggleMenu('Chapter4');">Database</a></div>
<div class="MenuSectionBlock" id="Chapter4" style="display: none;">
<div class="MI" id="Section66"><a href="http://www.codeproject.com/KB/database/">Database</a></div>
<div class="MI" id="Section100"><a href="http://www.codeproject.com/KB/reporting-services/">SQL Reporting Services</a></div>
</div>
<div class="MenuChapter"><a href="http://www.codeproject.com/script/Content/Chapter.aspx?chptId=8" onclick="return ToggleMenu('Chapter8');">Platforms, Frameworks &amp; Libraries</a></div>
<div class="MenuSectionBlock" id="Chapter8">
<div class="MI" id="Section83"><a href="http://www.codeproject.com/KB/atl/">ATL</a></div>
<div class="MI" id="Section117"><a href="http://www.codeproject.com/KB/MFC/">MFC</a></div>
<div class="MI" id="Section88"><a href="http://www.codeproject.com/KB/stl/">STL</a></div>
<div class="MI" id="Section84"><a href="http://www.codeproject.com/KB/wtl/">WTL</a></div>
<div class="MI" id="Section49"><a href="http://www.codeproject.com/KB/COM/">COM / COM+</a></div>
<div class="MIS" id="Section76"><a href="http://www.codeproject.com/KB/dotnet/">.NET Framework</a></div>
<div class="MI" id="Section92"><a href="http://www.codeproject.com/KB/winsdk/">Win32/64 SDK &amp; OS</a></div>
<div class="MI" id="Section108"><a href="http://www.codeproject.com/KB/vista/">Vista API</a></div>
<div class="MI" id="Section110"><a href="http://www.codeproject.com/KB/vista-security/">Vista Security</a></div>
<div class="MI" id="Section82"><a href="http://www.codeproject.com/KB/cross-platform/">Cross Platform</a></div>
<div class="MI" id="Section69"><a href="http://www.codeproject.com/KB/game/">Game Development</a></div>
<div class="MI" id="Section73"><a href="http://www.codeproject.com/KB/mobile/">Mobile Development</a></div>
<div class="MI" id="Section106"><a href="http://www.codeproject.com/KB/WC/">Windows CardSpace</a></div>
<div class="MI" id="Section103"><a href="http://www.codeproject.com/KB/WCF/">Windows Communication Foundation</a></div>
<div class="MI" id="Section104"><a href="http://www.codeproject.com/KB/WPF/">Windows Presentation Foundation</a></div>
<div class="MI" id="Section105"><a href="http://www.codeproject.com/KB/WF/">Windows Workflow Foundation</a></div>
<div class="MI" id="Section119"><a href="http://www.codeproject.com/KB/library/">Libraries</a></div>
<div class="MI" id="Section122"><a href="http://www.codeproject.com/KB/powershell/">Windows Powershell</a></div>
<div class="MI" id="Section123"><a href="http://www.codeproject.com/KB/linq/">LINQ</a></div>
</div>
<div class="MenuChapter"><a href="http://www.codeproject.com/script/Content/Chapter.aspx?chptId=5" onclick="return ToggleMenu('Chapter5');">Languages</a></div>
<div class="MenuSectionBlock" id="Chapter5" style="display: none;">
<div class="MI" id="Section71"><a href="http://www.codeproject.com/KB/cpp/">C / C++ Language</a></div>
<div class="MI" id="Section72"><a href="http://www.codeproject.com/KB/mcpp/">C++ / CLI</a></div>
<div class="MI" id="Section93"><a href="http://www.codeproject.com/KB/cs/">C#</a></div>
<div class="MI" id="Section78"><a href="http://www.codeproject.com/KB/msil/">MSIL</a></div>
<div class="MI" id="Section86"><a href="http://www.codeproject.com/KB/vbscript/">VBScript</a></div>
<div class="MI" id="Section87"><a href="http://www.codeproject.com/KB/vb/">VB.NET</a></div>
<div class="MI" id="Section115"><a href="http://www.codeproject.com/KB/vb-interop/">VB6 Interop</a></div>
<div class="MI" id="Section77"><a href="http://www.codeproject.com/KB/net-languages/">Other .NET Languages</a></div>
<div class="MI" id="Section21"><a href="http://www.codeproject.com/KB/XML/">XML</a></div>
<div class="MI" id="Section96"><a href="http://www.codeproject.com/KB/java/">Java</a></div>
</div>
<div class="MenuChapter"><a href="http://www.codeproject.com/script/Content/Chapter.aspx?chptId=6" onclick="return ToggleMenu('Chapter6');">General Programming</a></div>
<div class="MenuSectionBlock" id="Chapter6" style="display: none;">
<div class="MI" id="Section57"><a href="http://www.codeproject.com/KB/recipes/">Algorithms &amp; Recipes</a></div>
<div class="MI" id="Section64"><a href="http://www.codeproject.com/KB/bugs/">Bugs &amp; Workarounds</a></div>
<div class="MI" id="Section79"><a href="http://www.codeproject.com/KB/collections/">Collections</a></div>
<div class="MI" id="Section56"><a href="http://www.codeproject.com/KB/security/">Cryptography &amp; Security</a></div>
<div class="MI" id="Section50"><a href="http://www.codeproject.com/KB/datetime/">Date and Time</a></div>
<div class="MI" id="Section52"><a href="http://www.codeproject.com/KB/DLL/">DLLs &amp; Assemblies</a></div>
<div class="MI" id="Section80"><a href="http://www.codeproject.com/KB/exception/">Exception Handling</a></div>
<div class="MI" id="Section81"><a href="http://www.codeproject.com/KB/locale/">Localisation</a></div>
<div class="MI" id="Section53"><a href="http://www.codeproject.com/KB/macros/">Macros and Add-ins</a></div>
<div class="MI" id="Section54"><a href="http://www.codeproject.com/KB/tips/">Programming Tips</a></div>
<div class="MI" id="Section55"><a href="http://www.codeproject.com/KB/string/">String handling</a></div>
<div class="MI" id="Section22"><a href="http://www.codeproject.com/KB/IP/">Internet / Network</a></div>
<div class="MI" id="Section58"><a href="http://www.codeproject.com/KB/threads/">Threads, Processes &amp; IPC</a></div>
<div class="MI" id="Section59"><a href="http://www.codeproject.com/KB/winhelp/">WinHelp / HTMLHelp</a></div>
</div>
<div class="MenuChapter"><a href="http://www.codeproject.com/script/Content/Chapter.aspx?chptId=10" onclick="return ToggleMenu('Chapter10');">Graphics / Design</a></div>
<div class="MenuSectionBlock" id="Chapter10" style="display: none;">
<div class="MI" id="Section40"><a href="http://www.codeproject.com/KB/expression/">Expression</a></div>
<div class="MI" id="Section114"><a href="http://www.codeproject.com/KB/usability/">Usability</a></div>
</div>
<div class="MenuChapter"><a href="http://www.codeproject.com/script/Content/Chapter.aspx?chptId=11" onclick="return ToggleMenu('Chapter11');">Development Lifecycle</a></div>
<div class="MenuSectionBlock" id="Chapter11" style="display: none;">
<div class="MI" id="Section51"><a href="http://www.codeproject.com/KB/debug/">Debug Tips</a></div>
<div class="MI" id="Section39"><a href="http://www.codeproject.com/KB/architecture/">Design and Architecture</a></div>
<div class="MI" id="Section112"><a href="http://www.codeproject.com/KB/install/">Installation</a></div>
<div class="MI" id="Section41"><a href="http://www.codeproject.com/KB/work/">Work Issues</a></div>
<div class="MI" id="Section128"><a href="http://www.codeproject.com/KB/testing/">Testing and QA</a></div>
<div class="MI" id="Section126"><a href="http://www.codeproject.com/KB/codegen/">Code Generation</a></div>
</div>
<div class="MenuChapter"><a href="http://www.codeproject.com/script/Content/Chapter.aspx?chptId=7" onclick="return ToggleMenu('Chapter7');">General Reading</a></div>
<div class="MenuSectionBlock" id="Chapter7" style="display: none;">
<div class="MI" id="Section60"><a href="http://www.codeproject.com/KB/books/">Book Chapters</a></div>
<div class="MI" id="Section61"><a href="http://www.codeproject.com/KB/book-reviews/">Book Reviews</a></div>
<div class="MI" id="Section109"><a href="http://www.codeproject.com/KB/hardware-review/">Hardware Reviews</a></div>
<div class="MI" id="Section63"><a href="http://www.codeproject.com/KB/interviews/">Interviews</a></div>
<div class="MI" id="Section62"><a href="http://www.codeproject.com/KB/scrapbook/">Scrapbook</a></div>
<div class="MI" id="Section48"><a href="http://www.codeproject.com/KB/system/">Hardware &amp; System</a></div>
</div>
<div class="MenuChapter"><a href="http://www.codeproject.com/script/Content/Chapter.aspx?chptId=12" onclick="return ToggleMenu('Chapter12');">Third Party Products</a></div>
<div class="MenuSectionBlock" id="Chapter12" style="display: none;">
<div class="MI" id="Section65"><a href="http://www.codeproject.com/KB/showcase/">Product Showcase</a></div>
<div class="MI" id="Section124"><a href="http://www.codeproject.com/KB/solution-center/">Solution Center</a></div>
</div>
</div>
<div style="margin-top: 5px;"></div>
<div class="MenuCat">Services</div>
<div class="MenuChapter"><a href="http://www.codeproject.com/script/Jobs/List.aspx">Job Board</a></div>
<div class="MenuChapter"><a href="http://www.codeproject.com/script/Catalog/index.aspx">Component Catalog</a></div>
<div class="MenuChapter"><a href="http://www.codeproject.com/Services/TradePub.aspx">Free Magazines</a></div>
<div style="margin-top: 5px;"></div>
<div class="MenuCat">Feature Zones</div>
<div class="MenuChapter"><a href="http://www.codeproject.com/kb/Showcase/">Product Showcase</a></div>
<div class="MenuChapter"><a href="http://www.codeproject.com/Zones/IBM/">IBM DeveloperWorks</a></div>
<div class="MenuChapter"><a href="http://www.codeproject.com/Zones/WhitePapers/">WhitePapers / Webcasts</a></div>
<div class="MenuChapter"><a href="http://www.codeproject.com/redir.aspx?adid=9054">.NET Bug Tracking</a></div>
<div class="MenuChapter"><a href="http://www.codeproject.com/redir.aspx?adid=8763">ASP.NET Web Hosting</a></div>
<div style="margin-top: 5px;"></div>


	<div style="margin: auto; width: 150px;"><iframe src="evtvwr.aspx_files/ServeHTML.html" scrolling="no" width="150" frameborder="0" height="80"></iframe>
	</div>
	
	<div style="margin: 10px auto auto; width: 160px;"><script type="text/javascript">document.write(unescape("%3ca%20href%3d%22http%3a%2f%2fwww.codeproject.com%2fRedir.aspx%3fadid%3d5305%26way%3dban%22%20target%3d%22_blank%22%20rel%3d%22nofollow%22%3e%3cimg%20src%3d%22http%3a%2f%2fwww.codeproject.com%2fscript%2fAdm%2fServeImg.aspx%3fFile%3d%252fscript%252fAdm%252fimages%252fIBMdeveloperWorks_160x600.gif%26C%3dFalse%26adid%3d5305%22%20alt%3d%22%22%20border%3d%220%22%20width%3d%22160%22%20height%3d%22600%22%3e%3c%2fa%3e"));</script><a href="http://www.codeproject.com/Redir.aspx?adid=5305&amp;way=ban" target="_blank" rel="nofollow"><img src="evtvwr.aspx_files/ServeImg_004.html" alt="" width="160" border="0" height="600"></a>
	</div>
</div>

<div id="ctl00_ArticlePane" class="ArticlePane">

	
<table class="SearchHeaderBar" width="100%" cellspacing="0">
<tbody><tr>
<td style="white-space: nowrap; width: 60%;" valign="middle" align="right">
<form method="get" action="/info/search.aspx" name="Search" style="margin: 0pt;">
<b>Search &nbsp;</b>
<input class="SmallText" name="artkw" style="width: 200px;">
<select class="SmallText" style="font-weight: bold;" name="sbo">
<option value="kw" selected="true">Articles</option>
<option value="fm">Messages</option>
<option value="s">Jobs</option>
<option value="ctlk">Search Catalog</option>

</select>
<input class="SmallText" style="font-weight: bold;" value=" Go! " type="submit"> &nbsp;
</form>
</td>

<td class="TinyText" style="white-space: nowrap;">
<a href="http://www.codeproject.com/info/search.aspx">Advanced Search</a><br>
<a href="http://www.codeproject.com/script/Content/SiteMap.aspx">Sitemap</a>

</td>
</tr>
</tbody></table>

	<a name="Main"></a>
	<span id="ctl00_ResultMessage"></span>
	
	
    
	<div id="ctl00_ArtDiv">
	<table border="0" cellpadding="0" cellspacing="0">	
	<tbody><tr valign="top">
		<td valign="top" width="100%">
		    
<table>

</table>



			
<div class="SmallText">
<img src="evtvwr.aspx_files/print.gif" alt="print" style="vertical-align: middle;" width="16" height="16"><a id="ctl00_ArticleHeaderLinks_PrintLnk" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?display=Print">Print</a> &nbsp;

<img src="evtvwr.aspx_files/report.gif" alt="Broken Article?" style="vertical-align: middle;" width="16" height="16"><a id="ctl00_ArticleHeaderLinks_BrokenLnk" href="http://www.codeproject.com/script/Articles/Report.aspx?aid=4153">Report</a> &nbsp;

 &nbsp;
 &nbsp;
	



<style type="text/css">
#ATD {
	position: absolute;
	top: -90px;
	left: -5000px;
	z-index: 200;
	display: none;
	white-space:nowrap;
	background-color:white;
	padding:10px;
	border: solid 1px #999;
}
</style>
<span id="SBI"><img src="evtvwr.aspx_files/add.gif" id="ctl00_ArticleHeaderLinks_AddTo_Img" alt="add" style="vertical-align: middle;" width="16" height="16">
<a href="#">Share</a></span>
<div style="left: 274px; top: 316px;" id="ATD">

<script language="JavaScript" type="text/javascript">
var socialLinks = new social();
socialLinks.addtoMethod=1;
socialLinks.Horizontal=false;
socialLinks.Showname=true;
socialLinks.DrawLinks("socialLinks", document.location.href, escape(document.title), 100, 0, "SmallText Bold", "AddTo");
socialLinks.setupMenu();
</script><div><a class="AddTo" title="Add this page to Digg" onclick="return socialLinks.addto(0);" href="#"><img src="evtvwr.aspx_files/AddTo_Digg.png" width="16" align="absmiddle" border="0" height="16"> Digg</a> </div><div><a class="AddTo" title="Add this page to Del.icio.us" onclick="return socialLinks.addto(1);" href="#"><img src="evtvwr.aspx_files/AddTo_Delicious.png" width="16" align="absmiddle" border="0" height="16"> Del.icio.us</a> </div><div><a class="AddTo" title="Add this page to Google" onclick="return socialLinks.addto(2);" href="#"><img src="evtvwr.aspx_files/AddTo_Google.png" width="16" align="absmiddle" border="0" height="16"> Google</a> </div><div><a class="AddTo" title="Add this page to Windows Live" onclick="return socialLinks.addto(3);" href="#"><img src="evtvwr.aspx_files/AddTo_Live.png" width="16" align="absmiddle" border="0" height="16"> Windows Live</a> </div><div><a class="AddTo" title="Add this page to Yahoo! MyWeb" onclick="return socialLinks.addto(4);" href="#"><img src="evtvwr.aspx_files/AddTo_Yahoo.png" width="16" align="absmiddle" border="0" height="16"> Yahoo! MyWeb</a> </div><div><a class="AddTo" title="Add this page to Technorati" onclick="return socialLinks.addto(5);" href="#"><img src="evtvwr.aspx_files/AddTo_Technorati.png" width="16" align="absmiddle" border="0" height="16"> Technorati</a> </div><div><a class="AddTo" title="Add this page to Blink" onclick="return socialLinks.addto(6);" href="#"><img src="evtvwr.aspx_files/AddTo_Blink.png" width="16" align="absmiddle" border="0" height="16"> Blink</a> </div><div><a class="AddTo" title="Add this page to Facebook" onclick="return socialLinks.addto(7);" href="#"><img src="evtvwr.aspx_files/AddTo_Facebook.png" width="16" align="absmiddle" border="0" height="16"> Facebook</a> </div><div><a class="AddTo" title="Add this page to Furl" onclick="return socialLinks.addto(8);" href="#"><img src="evtvwr.aspx_files/AddTo_Furl.png" width="16" align="absmiddle" border="0" height="16"> Furl</a> </div><div><a class="AddTo" title="Add this page to Simpy" onclick="return socialLinks.addto(9);" href="#"><img src="evtvwr.aspx_files/AddTo_Simpy.png" width="16" align="absmiddle" border="0" height="16"> Simpy</a> </div><div><a class="AddTo" title="Add this page to Reddit" onclick="return socialLinks.addto(10);" href="#"><img src="evtvwr.aspx_files/AddTo_Reddit.png" width="16" align="absmiddle" border="0" height="16"> Reddit</a> </div><div><a class="AddTo" title="Add this page to Newsvine" onclick="return socialLinks.addto(11);" href="#"><img src="evtvwr.aspx_files/AddTo_Newsvine.png" width="16" align="absmiddle" border="0" height="16"> Newsvine</a> </div><div><a class="AddTo" title="Add this page to Stumbleupon" onclick="return socialLinks.addto(12);" href="#"><img src="evtvwr.aspx_files/AddTo_stumbleupon.png" width="16" align="absmiddle" border="0" height="16"> Stumbleupon</a> </div><div><a class="AddTo" title="Add this page to Mr. Wong" onclick="return socialLinks.addto(13);" href="#"><img src="evtvwr.aspx_files/AddTo_MrWong.png" width="16" align="absmiddle" border="0" height="16"> Mr. Wong</a> </div>
</div>
 &nbsp;

<img src="evtvwr.aspx_files/discuss.gif" alt="Discuss" style="vertical-align: middle;" width="15" height="16"> <a href="#_comments">Discuss</a> &nbsp; 

<img src="evtvwr.aspx_files/mail.gif" alt="Recommend Article" style="vertical-align: middle;" width="16" height="16">&nbsp;<a id="ctl00_ArticleHeaderLinks_Recommend" href="http://www.codeproject.com/script/common/TellFriend.aspx?obtid=2&amp;obid=4153">Email</a>	
</div>
		</td>
		<td style="text-align: right; white-space: nowrap; width: 100px;">
		<table id="CurRat"><tbody><tr><td>            
<table><tbody><tr><td id="ctl00_ArticleRating_VL" style="white-space: nowrap;" class="SmallText" align="right"> 
<span id="ctl00_ArticleRating_VoteLabel">39 votes for this Article.</span></td>

<td><table border="1" cellpadding="0" cellspacing="0">
	<tbody><tr>
		<td width="20" align="left" bgcolor="White" height="7"><img src="evtvwr.aspx_files/red.gif" width="20" align="middle" border="0" height="7"></td>
		<td width="20" align="left" bgcolor="White" height="7"><img src="evtvwr.aspx_files/red.gif" width="20" align="middle" border="0" height="7"></td>
		<td width="20" align="left" bgcolor="White" height="7"><img src="evtvwr.aspx_files/red.gif" width="20" align="middle" border="0" height="7"></td>
		<td width="20" align="left" bgcolor="White" height="7"><img src="evtvwr.aspx_files/red.gif" width="20" align="middle" border="0" height="7"></td>
		<td style="padding: 0px; white-space: nowrap;" width="20" align="left" bgcolor="White" height="7"><img src="evtvwr.aspx_files/red.gif" width="12" align="middle" border="0" height="7"><img src="evtvwr.aspx_files/white.gif" width="8" align="middle" border="0" height="7"></td>
	</tr>
</tbody></table>
<span id="ctl00_ArticleRating_Votes" class="SmallText"></span></td></tr>
<tr id="ctl00_ArticleRating_PopularityRow">
	<td colspan="2" class="SmallText" align="right">
<a id="ctl00_ArticleRating_PopularityLnk" title="Calculated as rating x Log10(# votes)" href="http://www.codeproject.com/script/Articles/TopArticles.aspx?ta_so=1">Popularity: 7.34</a>
<span id="ctl00_ArticleRating_PopularityLbl"></span><span id="ratingVal">Rating: <b>4.62</b> out of 5</span></td>
</tr>
</tbody></table>



</td>
		<td>            
<div>
<table class="HistTable" title="Voting Distribution. Recent data only"><tbody><tr><td><img src="evtvwr.aspx_files/t.html" alt="" title="" width="10" border="0" height="1"><br>1</td>
<td><img src="evtvwr.aspx_files/pollcol.gif" alt="1 vote, 2.6%" title="1 vote, 2.6%" width="10" border="0" height="1"><br>2</td>
<td><img src="evtvwr.aspx_files/pollcol.gif" alt="1 vote, 2.6%" title="1 vote, 2.6%" width="10" border="0" height="1"><br>3</td>
<td><img src="evtvwr.aspx_files/pollcol.gif" alt="11 votes, 28.2%" title="11 votes, 28.2%" width="10" border="0" height="8"><br>4</td>
<td><img src="evtvwr.aspx_files/pollcol.gif" alt="26 votes, 66.7%" title="26 votes, 66.7%" width="10" border="0" height="20"><br>5</td>
</tr></tbody></table>
</div>



</td></tr></tbody></table>
		</td>
	</tr>
	</tbody></table>
	
	
	
	

	
	

	
	
	
	
	
	
	
	
	
	<div id="contentdiv">
	
	<!-- Main Page Contents Start -->
	

<!-- Article Starts -->

<ul class="download">
<li><a href="http://www.codeproject.com/KB/dotnet/EvtVwr/Evtvwr_src.zip">Download source files - 11.8 Kb</a></li></ul>
<h2>Introduction</h2>
<p>Ideally, a good software application should never, or occasionally,
come up with error conditions or exceptions. But as we all know, this
is far from reality. So, when an exception does occur, a good
application should just not log plain error messages, but also provide
troubleshooting information and detailed information about the error in
terms of its source and causes.</p>
<p>The Windows Event Viewer has always been the most suitable place to
log error messages generated by applications. This article explains how
we can use the .NET Event Logging API to effectively log error
information. The article also touches upon some practices for effective
error message management, like maintaining localized error messages and
troubleshooting hyperlinks. We shall begin with some basics of event
logging like event types, log-files, etc, and then cover the
implementation aspects with respect to .NET.</p>
<h2>Event types</h2>
<p>There are basically five types of events that can be logged. Each
event is of a particular type, and an error logging application
indicates the type of event when it reports one. The Event Viewer uses
this type, to determine the icon to display in the list view of the log.</p>
<p>
</p><table border="1">
<tbody>
<tr>
<td>
<p><b>Event Type</b></p></td>
<td><b>Description</b></td></tr>
<tr>
<td>Information</td>
<td>This indicates a significant, successful operation. For example, an event indicating that a service has started.</td></tr>
<tr>
<td>Warning</td>
<td>Warning events indicate problems that are not immediately
significant, but those that could cause problems in the future.
Resource consumption is a good example for a warning event. </td></tr>
<tr>
<td>
<p>Error</p></td>
<td>Error events indicate significant problems that the user should
know about. Error events usually indicate a loss of functionality or
data. </td></tr>
<tr>
<td>Failure Audit</td>
<td>Failure audit events are security events that occur when an audited
access attempt fails. A failed attempt to open a file (due to lack of
permissions) is an example for a failure audit event. </td></tr>
<tr>
<td>Success Audit</td>
<td>Failure audit events are security events that occur when an audited
access attempt fails. A failed attempt to open a file (due to lack of
permissions) is an example for a failure audit event </td></tr></tbody></table>
<h2>Event logging elements</h2>
<p>The following are the major elements that are used when logging events:</p>
<h3>Log-files</h3>
<p>log-file is the place where the all event entries are made. The event logging service uses information stored in the <code lang="text">EventLog</code> registry key. The <code lang="text">EventLog</code> key (shown in Figure.1) contains several sub-keys called <code lang="text">logfiles</code>.
log-file information in the registry is used to locate resources that
the event logging service needs when an application writes to and reads
from the event log. The default log-files are <i>Application</i>, <i>Security</i>, and <i>System</i>.</p>
<p><img alt="EventLog key in the Registry" src="evtvwr.aspx_files/eVTVWR1.JPG" width="123" height="96"></p>
<p><b>Figure 1:</b> <code lang="text">EventLog</code> key in the registry</p>
<p>Applications and services use the <i>Application</i> log-file, whereas device drivers use the <i>System</i> log-file. The system generates success and failure audit events in the <i>Security</i> log-file when auditing is turned on. Applications can also create custom log-files by adding an entry to the <code lang="text">EventLog</code>
registry key (This can be done programmatically as well). These logs
appear in the Event Viewer with the default log-files. It is a good
practice to have a separate log-file in the event viewer for your
application, as this makes isolating errors generated by your
application easier. Also, each log-file will be an independently
manageable unit. For instance, we can control the size of the log-file,
attach ACLs for security purposes etc. </p>
<h3>Event log records</h3>
<p>Information about each event is stored in the event log in an event
log record. The event log record includes time, type, source, and
category information of each event.</p>
<h3>Event sources</h3>
<p>The event source is the name of the software component (or a module
of the application) that logs the event. It is often the name of the
application, or the name of a subcomponent of the application, if the
application is large. While applications and services should add their
names to the Application log-file, or a custom log-file, the device
drivers should add their names to the <i>System</i> log-file. The <i>Security</i> log-file is for system use only. </p>
<p><img alt="Registry Structure: Event Source" src="evtvwr.aspx_files/Evtvwr2.jpg" width="122" height="126"></p>
<p><b>Figure 2:</b> Registry Structure: Event Source</p>
<p>Each log-file contains sub-keys for event sources (as shown in Fig
2).Each event source contains information specific to the software that
logs the events. The following table shows the various registry keys
that can be configured for an event source:</p>
<table border="1">
<tbody>
<tr>
<td><b>Registry Value</b></td>
<td><b>Description</b></td></tr>
<tr>
<td><code lang="text">CategoryCount</code></td>
<td>Specifies the number of event categories supported.</td></tr>
<tr>
<td><code lang="text">CategoryMessageFile</code></td>
<td>Specifies the path for the category message file. A category
message file contains language-dependent strings that describe the
categories.</td></tr>
<tr>
<td><code lang="text">DisplayNameFile</code></td>
<td>Specifies the file that stores the localized name of the event log.
The name stored in the specified file appears as the log name in the
Event Viewer. If this entry does not appear in the registry for an
event log, the Event Viewer displays the name of the registry sub key
as the log name.</td></tr>
<tr>
<td><code lang="text">DisplayNameID</code></td>
<td>Specifies the message identification number of the log name string.
This number indicates the message in which the localized display name
appears.</td></tr>
<tr>
<td><code lang="text">EventMessageFile</code></td>
<td>Specifies the path for the event message file. You can specify
multiple files, each separated by semicolons. An event message file
contains language-dependent strings that describe the events.</td></tr>
<tr>
<td><code lang="text">ParameterMessageFile</code></td>
<td>Specifies the path for the parameter message file. A parameter
message file contains language-independent strings that are to be
inserted into the event description strings.</td></tr>
<tr>
<td><code lang="text">TypesSupported</code></td>
<td>Specifies a bit mask of supported types.</td></tr></tbody></table>
<p>Basically, event sources can be used to classify error messages as
required by the application. For example, you can have sources like
reporting, calculations, user interface, etc for an accounting
application.</p>
<p>We shall see how we configure these values later in the article.</p>
<h3>Event categories</h3>
<p>Categories help organize events so that we can filter them in the
Event Viewer. Each event source can define its own numbered categories,
and the text strings to which they are mapped. The categories must be
numbered consecutively, beginning with the number one. The total number
of categories is stored in the <code lang="text">CategoryCount</code>
key for the event source. Categories can be stored in a separate
message file, or in a file that contains messages of other types. We
shall talk more about creating categories under the section titled
Message Files.</p>
<h3>Event identifiers</h3>
<p>Event identifiers identify a particular event uniquely. Each event
source can define its own numbered events, and the description strings
to which they are mapped. Event viewers present these descriptions
strings to the user.</p>
<h3>Message files</h3>
<p>Message files are text files that contain information about the
various messages and categories that applications want to support.
These text files are then compiled as resource DLLs. Resource DLLs are
small and fast when compared to normal DLLs. The advantage of these
resource DLLs is that we can have messages written in multiple
languages. By using these DLLs, we can have a truly localized
application with localized error messages. Each event source should
register message files that contain description strings for each event
identifier, event category, and parameters. These files are registered
in the <code lang="text">EventMessageFile</code>, <code lang="text">CategoryMessageFile</code>, and <code lang="text">ParameterMessageFile</code>
registry values for the event source. We can create a single message
file that contains descriptions for the event identifiers, categories,
and parameters, or create three separate message files. Several
applications can share the same message file.</p>
<h2>Implementation</h2>
<p>This article so far discussed the concepts behind event logging.
Now, let us consider the implementation aspects with respect to .NET.</p>
<h3>Creating an Event log-file</h3>
<p>There are two ways to create an event log-file:</p>
<ol>
<li>Manually creating the registry entries 
<p>This can be done by adding an entry under <code lang="text">HKEY_LOCAL_MACHINE\SYSTEM\Services\EventLog</code>.</p>
</li><li>Programmatically 
<p>To create log-files, event sources and also to log events in the event log we use the <code lang="vbnet">EventLog</code> class defined in the <code lang="vbnet">System.Diagnostics</code> namespace.</p><div class="SmallText" id="premain0" style="width: 100%; cursor: pointer;"><img preid="0" src="evtvwr.aspx_files/minus.gif" id="preimg0" width="9" height="9"><span preid="0" style="margin-bottom: 0pt;" id="precollapse0"> Collapse</span></div><pre style="margin-top: 0pt;" id="pre0" lang="vbnet"><span class="code-comment">'</span><span class="code-comment">Create the source, if it does not already exist. 
</span>
<span class="code-keyword">If</span> <span class="code-keyword">Not</span> EventLog.SourceExists(<span class="code-string">"</span><span class="code-string">MySource"</span>, <span class="code-string">"</span><span class="code-string">MyServer"</span>) <span class="code-keyword">Then</span> 
    EventLog.CreateEventSource(<span class="code-string">"</span><span class="code-string">MySource"</span>, <span class="code-string">"</span><span class="code-string">MyApp"</span>, <span class="code-string">"</span><span class="code-string">MyServer"</span>) 
<span class="code-keyword">End</span> <span class="code-keyword">If</span></pre>
<p>In the code piece shown above, we are creating an event source called <code lang="vbnet">MySource</code> under <em>MyApp </em>log-file on the machine <em>MyServer</em> if one does not already exist. </p></li></ol>
<h3>Creating event sources</h3>
<p>Event sources can be created manually or programmatically (as shown earlier), similar to <i>Event</i> log-files. If you are creating sources manually, then you have to create several keys such as <code lang="text">CategoryMessageFile</code> and <code lang="text">EventMessageFile</code> under the source. The snapshot given below shows the registry entries after the log-file and event sources are created. </p>
<p><img alt="Event Source Registry Entries" src="evtvwr.aspx_files/Evtvwr3.jpg" width="500" height="98"></p>
<p><b>Figure 3:</b> Event source registry entries</p>
<p>In Figure 3, we have created a log-file for the application called <i>MyApp</i>. Under this log-file, there are two sources <em>MySource1</em> and <em>MySource2</em>. In the example shown above, <em>Msg.dll </em>in the temp directory is used to obtain both messages and category names (as provided for the <code lang="text">CategoryMessageFile</code> and <code lang="text">EventMessageFile</code> entries). The event source has three categories (<code lang="text">CategoryCount</code> is set to 3), and all event types are supported (<code lang="text">TypesSupported</code> is set to 7).</p>
<h3>Message files</h3>
<p>A detailed explanation of message text file syntax is beyond the scope of this document.<!-- However, for more information you can refer: <A 
href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tools/mc_77lf.asp" 
target=_blank>http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tools/mc_77lf.asp</A>.--></p>
<p>Given below is a sample message text file:</p><div class="SmallText" id="premain1" style="width: 100%; cursor: pointer;"><img preid="1" src="evtvwr.aspx_files/minus.gif" id="preimg1" width="9" height="9"><span preid="1" style="margin-bottom: 0pt;" id="precollapse1"> Collapse</span></div><pre style="margin-top: 0pt;" id="pre1" lang="text">;//**************Category Definitions************
MessageId=1
Facility=Application
Severity=Success
SymbolicName=CAT1
Language=English
MyCategory1
.
MessageId=2
Facility=Application
Severity=Success
SymbolicName=CAT2
Language=English
MyCategory2
.

;//***********Event Definitions**************
MessageId=1000
Severity=Success
SymbolicName=MSG1
Language=English
My Error Message
.
MessageId=2000
Severity=Success
SymbolicName=GENERIC
Language=English
%1
.</pre>
<p>Note: Message files can be in Unicode to support messages written in
any language. In the example given above, messages are written in
English. The categories and messages have also been provided in the
same file.</p>
<h3>Creating Message DLLs</h3>
<p>We need to compile the message file to a resource-only DLL. The following steps explain the conversion process:</p>
<ol>
<li>Create a <i>.mc</i> file to define the message resource table. This
file has all the error messages and categories of an application. Use
the message compiler to create <i>.rc</i> and <i>.bin</i> files from the <i>.mc</i> file. <div class="SmallText" id="premain2" style="width: 100%; cursor: pointer;"><img preid="2" src="evtvwr.aspx_files/minus.gif" id="preimg2" width="9" height="9"><span preid="2" style="margin-bottom: 0pt;" id="precollapse2"> Collapse</span></div><pre style="margin-top: 0pt;" id="pre2" lang="text"><b>mc </b>filename.mc.</pre>
</li><li>Use the resource compiler to create a <i>.res</i> file. <div class="SmallText" id="premain3" style="width: 100%; cursor: pointer;"><img preid="3" src="evtvwr.aspx_files/minus.gif" id="preimg3" width="9" height="9"><span preid="3" style="margin-bottom: 0pt;" id="precollapse3"> Collapse</span></div><pre style="margin-top: 0pt;" id="pre3" lang="text"><b>rc -r -fo</b> filename.res filename.rc </pre>
</li><li>Use the linker to create a <i>.dll</i> file. <div class="SmallText" id="premain4" style="width: 100%; cursor: pointer;"><img preid="4" src="evtvwr.aspx_files/minus.gif" id="preimg4" width="9" height="9"><span preid="4" style="margin-bottom: 0pt;" id="precollapse4"> Collapse</span></div><pre style="margin-top: 0pt;" id="pre4" lang="text"><b>link -dll -noentry -out</b>:filename.dll filename.res </pre></li></ol>
<h3>Logging an error</h3>
<p>To log an event into the event log, the <code lang="vbnet">WriteEntry</code><strong> </strong>method of the <code lang="vbnet">EventLog</code><strong> </strong>class can be used. Given below is a code snippet detailing how a message can be logged: </p><div class="SmallText" id="premain5" style="width: 100%; cursor: pointer;"><img preid="5" src="evtvwr.aspx_files/minus.gif" id="preimg5" width="9" height="9"><span preid="5" style="margin-bottom: 0pt;" id="precollapse5"> Collapse</span></div><pre style="margin-top: 0pt;" id="pre5" lang="vbnet"><span class="code-keyword">Dim</span> objEventLog <span class="code-keyword">As</span> <span class="code-keyword">New</span> EventLog()

<span class="code-comment">'</span><span class="code-comment">Register the App as an Event Source
</span>
<span class="code-keyword">If</span> <span class="code-keyword">Not</span> objEventLog.SourceExists(<span class="code-string">"</span><span class="code-string">MySource1"</span>) <span class="code-keyword">Then</span>
      objEventLog.CreateEventSource(<span class="code-string">"</span><span class="code-string">MySource1"</span>,<span class="code-string">"</span><span class="code-string">MyApp"</span>)
<span class="code-keyword">End</span> <span class="code-keyword">If</span>
objEventLog.Source = <span class="code-string">"</span><span class="code-string">MySource1"</span>
objEventLog.WriteEntry(<span class="code-string">"</span><span class="code-string">"</span>, EventLogEntryType.Error, 1000, <span class="code-keyword">CShort</span>(<span class="code-digit">1</span>))</pre>
<p>For the code sample above, refer to the message text file shown earlier. </p>
<p>Note a couple of things here. We are passing the <code lang="vbnet">EventID</code>
parameter as 1000. This corresponds to the message "My Error Message"
in the message text file. This will be displayed as the message in the
event log. Also, we are passing the <code lang="vbnet">CategoryID</code> as 1. This corresponds to the category of <em>MyCategory1</em>.
Note that I am not passing any error message as this is picked up from
the message file. Figure 4 illustrates how the event log entry would
look like when the above code snippet is executed: </p>
<p><img src="evtvwr.aspx_files/Evtvwr4.jpg" width="500" height="250"></p>
<p><b>Figure 4:</b> An event log entry with the <code lang="vbnet">EventID</code> and <code lang="vbnet">Category</code></p>
<p>We now have our own node in the event viewer. By looking at the
event log, the user gets a fair amount of information like the source
of the error and its category. Not only that, this makes filtering
messages easier as we now have our own Sources and Categories. Also, by
using the same method, we have effectively segregated error messages
from the application code itself. This would help us maintain a uniform
standard for error messages across applications, and also take us a
step closer to localization.</p>
<h3>Providing links in error messages</h3>
<p>Another good feature the Event Viewer provides is that of hyperlinks
in the error messages, which can be linked to a web page detailing more
about the error. This would help an end user understand and troubleshot
the error. For example, the message given below has a link to a web
page:</p>
<p><img src="evtvwr.aspx_files/evtvwr5.jpg" width="279" height="312"></p>
<p><b>Figure 5:</b> Troubleshooting Link given with an Error Message</p>
<p>On clicking this link, we would be prompted with a dialog box as shown below:</p>
<p><img src="evtvwr.aspx_files/Evtvwr6.jpg" width="288" height="154"></p>
<p><b>Figure 6:</b> Posting Error Information to a designated place</p>
<p>When the user confirms to send this information, a web page can be
programmed to receive this information, and display troubleshooting
information to the user based on the <code lang="vbnet">EventID</code>, <code lang="vbnet">Category</code>, and <code lang="vbnet">Source</code> sent from the client (This information is sent as query string parameters).</p>
<h2>Conclusion</h2>
<p>The event viewer definitely provides a wealth of features through
which error messages can be effectively logged and tracked. By
exploiting these features, we would help end users to understand the
errors and their sources better, and this in turn can simplify things
for the support group. </p>
<h3>A note about the source files</h3>
<p>Included with this article is a simple VB.NET project which just shows how the <code lang="vbnet">WriteEntry</code> method of the <code lang="vbnet">EventLog</code> class can be used. The zip also includes a <i>.reg</i>
file which should be run to create the custom log-file and to register
the event sources. Note that some paths are hard coded in the <i>.reg</i> file. So, change them accordingly. Finally, a batch file <i>Compile.bat</i> is included to compile the <i>.mc</i> file to create a message DLL.</p>



<!-- Article Ends -->


	<!-- Main Page Contents End -->
	
	</div>
	
	
	<form name="aspnetForm" method="post" action="evtvwr.aspx" id="aspnetForm" style="margin: 0pt; padding: 0pt;">
<div>
<input name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTEwMDUyNjYzMjgPZBYCZg9kFgQCCw9kFgYCAw8PFgIeB1Zpc2libGVnZGQCCQ8PFgIfAGdkZAIMDw8WAh8AZ2RkAgwPZBYKAgcPZBYOAgEPZBYCZg8WAh4LXyFJdGVtQ291bnRmZAIDD2QWCmYPDxYCHgtOYXZpZ2F0ZVVybAUkL0tCL2RvdG5ldC9ldnR2d3IuYXNweD9kaXNwbGF5PVByaW50ZGQCAQ8PFgIfAgUlL3NjcmlwdC9BcnRpY2xlcy9SZXBvcnQuYXNweD9haWQ9NDE1M2RkAgIPDxYCHwBoZGQCAw8PFgIfAGhkZAIFDw8WAh8CBTAvc2NyaXB0L2NvbW1vbi9UZWxsRnJpZW5kLmFzcHg/b2J0aWQ9MiZvYmlkPTQxNTNkZAIFD2QWBAIBD2QWAgIBDw8WAh4EVGV4dAUaMzkgdm90ZXMgZm9yIHRoaXMgQXJ0aWNsZS5kZAIGD2QWAmYPZBYEAgEPDxYEHwMFEFBvcHVsYXJpdHk6IDcuMzQfAgUpL3NjcmlwdC9BcnRpY2xlcy9Ub3BBcnRpY2xlcy5hc3B4P3RhX3NvPTFkZAIFDxYCHwMFHFJhdGluZzogPGI+NC42MjwvYj4gb3V0IG9mIDVkAhkPZBYKAgEPZBYEAgEPFgIeCWlubmVyaHRtbAWxAjxwPlRoaXMgYXJ0aWNsZSBoYXMgbm8gZXhwbGljaXQgbGljZW5zZSBhdHRhY2hlZCB0byBpdCBidXQgbWF5IGNvbnRhaW4gdXNhZ2UgdGVybXMgaW4gdGhlIGFydGljbGUgdGV4dCBvciB0aGUgZG93bmxvYWQgZmlsZXMgdGhlbXNlbHZlcy4gSWYgaW4gZG91YnQgcGxlYXNlIGNvbnRhY3QgdGhlIGF1dGhvciB2aWEgdGhlIGRpc2N1c3Npb24gYm9hcmQgYmVsb3cuPC9wPjxwPkEgbGlzdCBvZiBsaWNlbnNlcyBhdXRob3JzIG1pZ2h0IHVzZSBjYW4gYmUgZm91bmQgPGEgaHJlZj0iL2luZm8vTGljZW5zZXMuYXNweCI+aGVyZTwvYT48L3A+ZAICD2QWAgIBDxBkZBYAZAIFDxYCHwECAWQCBw8WAh8DBY0IPGgyPk90aGVyIHBvcHVsYXIgLk5FVCBGcmFtZXdvcmsgYXJ0aWNsZXM6PC9oMj48dWw+PGxpPjxhIGhyZWY9Ii9LQi9kb3RuZXQvcmVnZXh0dXRvcmlhbC5hc3B4Ij5UaGUgMzAgTWludXRlIFJlZ2V4IFR1dG9yaWFsPC9hPjxkaXYgY2xhc3M9IlNtYWxsVGV4dCI+TGVhcm4gaG93IHRvIHVzZSByZWd1bGFyIGV4cHJlc3Npb25zIGluIDMwIG1pbnV0ZXMgd2l0aCBFeHByZXNzby48L2Rpdj48L2xpPjxsaT48YSBocmVmPSIvS0IvZG90bmV0L3N0cmluZ3MuYXNweCI+U3RyaW5ncyBVTkRPQ1VNRU5URUQ8L2E+PGRpdiBjbGFzcz0iU21hbGxUZXh0Ij5EZXRhaWxlZCBsb29rZWQgYXQgdGhlIGltcGxlbWVudGF0aW9uIG9mIHN0cmluZ3MgaW4gLk5FVDwvZGl2PjwvbGk+PGxpPjxhIGhyZWY9Ii9LQi9kb3RuZXQvZXhwcmVzc28uYXNweCI+RXhwcmVzc28gLSBBIFRvb2wgZm9yIEJ1aWxkaW5nIGFuZCBUZXN0aW5nIFJlZ3VsYXIgRXhwcmVzc2lvbnM8L2E+PGRpdiBjbGFzcz0iU21hbGxUZXh0Ij5Gb3IgbGVhcm5pbmcsIGJ1aWxkaW5nLCBhbmQgZGVidWdnaW5nIC5ORVQgRnJhbWV3b3JrIHJlZ3VsYXIgZXhwcmVzc2lvbnM8L2Rpdj48L2xpPjxsaT48YSBocmVmPSIvS0IvZG90bmV0L215c3Rlcmllc29mY29uZmlndXJhdGlvbi5hc3B4Ij5VbnJhdmVsaW5nIHRoZSBNeXN0ZXJpZXMgb2YgLk5FVCAyLjAgQ29uZmlndXJhdGlvbjwvYT48ZGl2IGNsYXNzPSJTbWFsbFRleHQiPkxlYXJuIGhvdyB0byB1dGlsaXplIHRoZSBwb3dlcmZ1bCBuZXcgLk5FVCAyLjAgY29uZmlndXJhdGlvbiBmZWF0dXJlcyB0byBzaW1wbGlmeSBhbmQgY2VudHJhbGl6ZSB5b3VyIGNvbmZpZ3VyYXRpb24gY29kZS48L2Rpdj48L2xpPjxsaT48YSBocmVmPSIvS0IvZG90bmV0L3NpbXBsZXdpbmRvd3NzZXJ2aWNlLmFzcHgiPlNpbXBsZSBXaW5kb3dzIFNlcnZpY2UgU2FtcGxlPC9hPjxkaXYgY2xhc3M9IlNtYWxsVGV4dCI+QSBzaW1wbGUgYXBwbGljYXRpb24gdG8gc2hvdyBob3cgdG8gY3JlYXRlIGEgV2luZG93cyBzZXJ2aWNlLjwvZGl2PjwvbGk+PC91bD5kAgkPDxYCHwBnZGQCDQ9kFgJmD2QWAgIBD2QWAmYPZBYCAgkPFgIfAGgWAgIBDxBkZBYAZAIbDw8WAh8AZ2RkAh0PDxYCHwBnZGQCJQ8WAh8AaGQCCQ8PFgIfAgUmL3NjcmlwdC9BcnRpY2xlcy9BcnRpY2xlLmFzcHg/YWlkPTQxNTNkZAIPDxYCHwMFCzE3IE1heSAyMDAzZAIRDw8WBB8DBQ5TbWl0aGEgVmlqYXlhbh8CBSovc2NyaXB0L01lbWJlcnNoaXAvUHJvZmlsZXMuYXNweD9taWQ9Mjg5NzBkZAITDxYCHwMFGUNvcHlyaWdodCAyMDAzIGJ5IE1hbm9qIEdkZJckwSoyRypp/AtFGXCtK+bP6c6F" type="hidden">
</div>


	
	<h2>License</h2>
	<div id="ctl00_LicenseTerms"><p>This
article has no explicit license attached to it but may contain usage
terms in the article text or the download files themselves. If in doubt
please contact the author via the discussion board below.</p><p>A list of licenses authors might use can be found <a href="http://www.codeproject.com/info/Licenses.aspx">here</a></p></div>
	
	<h2>About the Author</h2>
	
			
            
<table width="100%" border="0" cellpadding="0" cellspacing="5">
<tbody><tr valign="top">
<td id="ctl00_AboutAuthorRptr_ctl00_AboutAuthor_memberPhotoTable" style="width: 155px;" valign="top">
	<b><a id="ctl00_AboutAuthorRptr_ctl00_AboutAuthor_memberProfileLink" href="http://www.codeproject.com/script/Membership/Profiles.aspx?mid=144339">Manoj G</a></b><br><br>
	<center><img id="ctl00_AboutAuthorRptr_ctl00_AboutAuthor_memberPhoto" src="evtvwr.aspx_files/FA7233AB-A47A-4AA5-95FB-1D59335E3266.jpg" style="border-width: 0px;"></center><br>
	<span id="ctl00_AboutAuthorRptr_ctl00_AboutAuthor_memberType" class="SmallText"></span>
		
</td>

<td> I am a software developer and have worked on Microsoft
technologies for about five years now. I have always been fascinated by
Microsoft technologies and with the advent of .NET , this fascination
has reached new heights. I take a lot of interest reading technical
articles and equally enjoy writing them. I really like to be called a
.NET junkie and will surely try to live up to this name <img src="evtvwr.aspx_files/smiley_smile.gif" alt="Smile" align="top"><br><br>I am <b>.NET MVP</b> and have also completed <b>MCAD, MCSD(VS 6), MCDBA (SQL Server 2000), MCSA (Win 2K)</b> and <b> MCTS (Distributed Apps) </b> certfications.<br>	

	<table>
	<tbody><tr id="ctl00_AboutAuthorRptr_ctl00_AboutAuthor_jobTitleRow">
	<td class="SmallText" nowrap="nowrap">Occupation: </td>
	<td width="100%"><span id="ctl00_AboutAuthorRptr_ctl00_AboutAuthor_memberJobTitle" class="SmallText">Web Developer</span></td>
</tr>


	

	<tr id="ctl00_AboutAuthorRptr_ctl00_AboutAuthor_locationRow">
	<td class="SmallText">Location: </td>
	<td width="100%"><span id="ctl00_AboutAuthorRptr_ctl00_AboutAuthor_memberLocation" class="SmallText"><img src="evtvwr.aspx_files/IN.gif" alt="India" width="16" height="11"> India</span></td>
</tr>

	</tbody></table>
	
</td>
</tr>
</tbody></table>

			<br>
		
	
	<table width="100%" border="0" cellpadding="0" cellspacing="0">	
	<tbody><tr valign="top">			
		<td style="width: 100%;">
			<h2>Other popular .NET Framework articles:</h2><ul><li><a href="http://www.codeproject.com/KB/dotnet/regextutorial.aspx">The 30 Minute Regex Tutorial</a><div class="SmallText">Learn how to use regular expressions in 30 minutes with Expresso.</div></li><li><a href="http://www.codeproject.com/KB/dotnet/strings.aspx">Strings UNDOCUMENTED</a><div class="SmallText">Detailed looked at the implementation of strings in .NET</div></li><li><a href="http://www.codeproject.com/KB/dotnet/expresso.aspx">Expresso - A Tool for Building and Testing Regular Expressions</a><div class="SmallText">For learning, building, and debugging .NET Framework regular expressions</div></li><li><a href="http://www.codeproject.com/KB/dotnet/mysteriesofconfiguration.aspx">Unraveling the Mysteries of .NET 2.0 Configuration</a><div class="SmallText">Learn how to utilize the powerful new .NET 2.0 configuration features to simplify and centralize your configuration code.</div></li><li><a href="http://www.codeproject.com/KB/dotnet/simplewindowsservice.aspx">Simple Windows Service Sample</a><div class="SmallText">A simple application to show how to create a Windows service.</div></li></ul>
		</td>
		<td>
			<script type="text/javascript">document.write(unescape("%3ca%20href%3d%22http%3a%2f%2fwww.codeproject.com%2fRedir.aspx%3fadid%3d8672%26way%3dban%22%20target%3d%22_blank%22%20rel%3d%22nofollow%22%3e%3cimg%20src%3d%22http%3a%2f%2fwww.codeproject.com%2fscript%2fAdm%2fServeImg.aspx%3fFile%3d%252fscript%252fAdm%252fimages%252f20082-300x250.png%26C%3dFalse%26adid%3d8672%22%20alt%3d%22%22%20border%3d%220%22%20width%3d%22300%22%20height%3d%22250%22%3e%3c%2fa%3e"));</script><a href="http://www.codeproject.com/Redir.aspx?adid=8672&amp;way=ban" target="_blank" rel="nofollow"><img src="evtvwr.aspx_files/ServeImg_003.html" alt="" width="300" border="0" height="250"></a>
									 
		</td>
	</tr>
	</tbody></table>

	<table id="ctl00_RateArticleRow" class="RatingBar" width="100%" border="0" cellpadding="0" cellspacing="0">
	<tbody><tr>
		<td><a href="#_top">Article Top</a></td>
		<td align="right">            
<table width="100%" cellpadding="0" cellspacing="0"><tbody><tr>

	
	
	<td id="voteTbl" style="white-space: nowrap;" class="SmallText" align="right">
	
		<table><tbody><tr>
		<td id="ctl00_RateArticle_SignIn" nowrap="nowrap"><a href="#SignUp">Sign Up</a> to vote for this article</td>
		
		
		
		
		
		<td><span id="ctl00_RateArticle_ErrorMessage"></span></td>
		</tr></tbody></table>
		
	</td>
</tr></tbody></table>

<div id="RateComDiv" style="display: none;">
<table width="100%"><tbody><tr valign="top"><td width="100%" align="right">Your reason for this vote:</td>
<td><textarea id="RateComment" rows="5" cols="60" style="width: 285px; float: right;"></textarea>
</td></tr></tbody></table></div>



</td>
	</tr>
</tbody></table>

	</form>
	
	<div style="overflow: hidden; margin-left: 40px; white-space: nowrap;">
		<script type="text/javascript">document.write(unescape("%3ca%20href%3d%22http%3a%2f%2fwww.codeproject.com%2fRedir.aspx%3fadid%3d9017%26way%3dban%22%20target%3d%22_blank%22%20rel%3d%22nofollow%22%3e%3cimg%20src%3d%22http%3a%2f%2fwww.codeproject.com%2fscript%2fAdm%2fServeImg.aspx%3fFile%3d%252fscript%252fAdm%252fimages%252fcountersoft_468x60-v1.gif%26C%3dFalse%26adid%3d9017%22%20alt%3d%22%22%20border%3d%220%22%20width%3d%22468%22%20height%3d%2260%22%3e%3c%2fa%3e"));</script><a href="http://www.codeproject.com/Redir.aspx?adid=9017&amp;way=ban" target="_blank" rel="nofollow"><img src="evtvwr.aspx_files/ServeImg_002.html" alt="" width="468" border="0" height="60"></a>
		<iframe src="evtvwr.aspx_files/ServeLinks.html" scrolling="no" width="300" frameborder="0" height="60"></iframe>
			  
			
		 
	</div>

	<a name="_comments"></a><!-- Forum Start -->
<div id="_MessageBoard" onclick="return SwitchMessage(event, null)">
	<table id="ForumTable" class="Frm_MainTable" cellpadding="0" cellspacing="0">
		<tbody><tr>
			<td class="Frm_MsgAlert"><b>You must <a href="http://www.codeproject.com/script/Membership/LogOn.aspx?rp=%2fKB%2fdotnet%2fevtvwr.aspx%3ffid%3d15511%26df%3d90%26mpp%3d25%26noise%3d3%26sort%3dPosition%26view%3dQuick">Sign In</a> to use this message board.</b></td>
		</tr><tr>
			<td><form action="/script/Forums/SetOptions.aspx?floc=%2fKB%2fdotnet%2fevtvwr.aspx&amp;fid=15511&amp;df=90&amp;mpp=25&amp;noise=3&amp;sort=Position&amp;view=Quick" method="get" style="margin: 0pt; padding: 0pt;">
				<input name="fid" value="15511" type="hidden"><input name="currentQS" value="?floc=%2fKB%2fdotnet%2fevtvwr.aspx&amp;fid=15511&amp;df=90&amp;mpp=25&amp;noise=3&amp;sort=Position&amp;view=Quick" type="hidden"><input name="floc" value="/KB/dotnet/evtvwr.aspx" type="hidden"><table width="100%" border="0" cellpadding="3" cellspacing="0">
					<tbody><tr class="Frm_HeaderRow1">
						<td style="white-space: nowrap;"><img src="evtvwr.aspx_files/forum_faq.gif" alt="FAQ" width="16" align="middle" border="0" height="16">&nbsp;<a href="http://www.codeproject.com/script/Forums/FAQ.aspx"><b>FAQ</b></a>&nbsp;</td><td style="white-space: nowrap; text-align: right;">Noise Tolerance<select size="1" class="Frm_DropDown" name="noise">
							<option value="1">Very High</option><option value="2">High</option><option selected="selected" value="3">Medium</option><option value="4">Low</option><option value="5">Very Low</option>
						</select></td><td colspan="2" style="white-space: nowrap; text-align: right;"><img src="evtvwr.aspx_files/forum_search.gif" alt="Search" width="16" align="top" border="0" height="15">&nbsp;<a href="http://www.codeproject.com/script/Forums/Search.aspx?fid=15511">Search Messages</a>&nbsp;</td><td style="text-align: right;"><input value="Set Options" name="SetOpt" class="Frm_Button" type="submit"></td>
					</tr><tr class="Frm_HeaderRow2">
						<td style="width: 100%;">&nbsp;</td><td style="white-space: nowrap; text-align: right;">Layout<select size="1" class="Frm_DropDown" name="view">
							<option selected="selected" value="Quick">Normal</option><option value="Topic">Expand Root Messages</option><option value="Expanded">Expand All Messages</option><option value="Thread">Thread View</option><option value="Normal">No Javascript (slow)</option><option value="Preview">No Javascript Preview</option>
						</select>&nbsp;&nbsp;</td><td style="white-space: nowrap;">Per page<select size="1" class="Frm_DropDown" name="mpp">
							<option value="10">10</option><option selected="selected" value="25">25</option><option value="50">50</option>
						</select>&nbsp;&nbsp;</td><td colspan="2">&nbsp;</td>
					</tr>
				</tbody></table>
			</form></td>
		</tr><tr>
			<td><a name="xx0xx"></a><table width="100%" border="0" cellpadding="2" cellspacing="0">
				<tbody><tr class="Frm_NavigationBar">
					<td>&nbsp;</td><td>Msgs 1 to 25 of 46 (Total in Forum: 46) (<a href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;noise=3&amp;sort=Position&amp;view=Quick">Refresh</a>)</td><td style="text-align: right; white-space: nowrap;"><span class="Frm_HL">First</span><span class="Frm_HL">Prev</span><a class="Frm_HL" name="Frm_HoverNL" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;noise=3&amp;sort=Position&amp;view=Quick&amp;fr=26#xx0xx">Next</a></td>
				</tr>
			</tbody></table></td>
		</tr><tr>
			<td><table class="Frm_MsgTable" width="100%" border="0" cellpadding="0" cellspacing="0">
				<tbody><tr>
					<td><img src="evtvwr.aspx_files/t_002.gif" alt="" width="1" border="0" height="5"></td>
				</tr>
<!-- Start Message head -->

				<tr class="MsgHd Rt HdUnSel" id="F2276572_h0">
					<td width="100%"><table class="QuickHd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" width="16"><a name="xx2276572xx"></a><img src="evtvwr.aspx_files/msg_general.gif" alt="General" width="16" align="top" height="16"></td><td class="Frm_MsgSubject"><a id="DynMessLink" name="2276572" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;noise=3&amp;sort=Position&amp;view=Quick&amp;select=2276572#xx2276572xx">Restart at eventviewer service</a></td><td style="width: 20px; white-space: nowrap;"><img src="evtvwr.aspx_files/member_sm.gif" title="member" alt="member" border="0" height="16"></td><td class="Frm_MsgAuthor"><a href="http://www.codeproject.com/script/Membership/Profiles.aspx?mid=1861233">AssebRic</a></td><td class="Frm_MsgDate" style="vertical-align: top; white-space: nowrap;">7:02 17 Oct '07 &nbsp;</td>
						</tr>
					</tbody></table></td>
				</tr><!-- End Message head -->

				<tr id="F2276572_h1" style="display: none;">
					<td width="100%"><table class="QuickBd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" style="width: 16px;"><img src="evtvwr.aspx_files/t_002.gif" alt="" width="16" height="1"></td><td class="MsgBd BdSel"><table width="100%" border="0" cellpadding="0" cellspacing="5">
								<tbody><tr>
									<td><table width="100%" border="0" cellpadding="0" cellspacing="0">
										<tbody><tr>
											<td colspan="2">If
you're using a source that already exists you should delete from the
previous "store" and put in the new one... this is not a problem...
when i try it a message like this appears:<br><br>"The description for
Event ID ( 1000 ) in Source ( AppSource ) cannot be found. The local
computer may not have the necessary registry information or message DLL
files to display messages from a remote computer. The following
information is part of the event: Generic Message. "<br><br><br>The
solution, for now, is to restart the machine... after this everything
is great..i think that the sources are in memory after windows starts..<br><br>Do you have one simple solution? i need to do this programatically<br><br>thanks and great post <img src="evtvwr.aspx_files/smiley_smile.gif" alt="Smile" align="top"> <br><br><div class="ForumSig">We all need...</div><br></td>
										</tr><tr style="vertical-align: middle;">
											<td class="Frm_MsgFt"><a class="Frm_MHL" href="http://www.codeproject.com/script/Membership/LogOn.aspx?rp=%2fKB%2fdotnet%2fevtvwr.aspx">Sign In</a>·<a class="Frm_MHL" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;sort=Position&amp;tid=2276572" title="View Thread">View Thread</a>·<a class="Frm_MHL" href="http://www.codeproject.com/script/Forums/View.aspx?fid=15511&amp;msg=2276572" title="Get permanent link">PermaLink</a></td><td class="Frm_MsgFt" style="text-align: right;"><span id="MVF2276572" style="white-space: nowrap;"></span></td>
										</tr>
									</tbody></table></td>
								</tr>
							</tbody></table></td>
						</tr>
					</tbody></table></td>
				</tr><tr class="Quick">
					<td class="Frm_MsgRtDivide"><img src="evtvwr.aspx_files/t_002.gif" alt="" width="1" border="0" height="1"></td>
				</tr>
<!-- Start Message head -->

				<tr class="MsgHd Rt HdUnSel" id="F1773025_h0">
					<td width="100%"><table class="QuickHd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" width="16"><a name="xx1773025xx"></a><img src="evtvwr.aspx_files/msg_general.gif" alt="General" width="16" align="top" height="16"></td><td class="Frm_MsgSubject"><a id="DynMessLink" name="1773025" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;noise=3&amp;sort=Position&amp;view=Quick&amp;select=1773025#xx1773025xx">.Evt File [modified]</a></td><td style="width: 20px; white-space: nowrap;"><img src="evtvwr.aspx_files/member_sm.gif" title="member" alt="member" border="0" height="16"></td><td class="Frm_MsgAuthor"><a href="http://www.codeproject.com/script/Membership/Profiles.aspx?mid=54353">RadioButton</a></td><td class="Frm_MsgDate" style="vertical-align: top; white-space: nowrap;">8:01 23 Nov '06 &nbsp;</td>
						</tr>
					</tbody></table></td>
				</tr><!-- End Message head -->

				<tr id="F1773025_h1" style="display: none;">
					<td width="100%"><table class="QuickBd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" style="width: 16px;"><img src="evtvwr.aspx_files/t_002.gif" alt="" width="16" height="1"></td><td class="MsgBd BdSel"><table width="100%" border="0" cellpadding="0" cellspacing="5">
								<tbody><tr>
									<td><table width="100%" border="0" cellpadding="0" cellspacing="0">
										<tbody><tr>
											<td colspan="2">How
does the CustomLog .Evt file get generated? I have gone as far as using
the EventLogInstaller class. Using Installutil.exe to install my log. <br><br>Thanks so much for the help.<br>RB<br> <br></td>
										</tr><tr style="vertical-align: middle;">
											<td class="Frm_MsgFt"><a class="Frm_MHL" href="http://www.codeproject.com/script/Membership/LogOn.aspx?rp=%2fKB%2fdotnet%2fevtvwr.aspx">Sign In</a>·<a class="Frm_MHL" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;sort=Position&amp;tid=1773025" title="View Thread">View Thread</a>·<a class="Frm_MHL" href="http://www.codeproject.com/script/Forums/View.aspx?fid=15511&amp;msg=1773025" title="Get permanent link">PermaLink</a></td><td class="Frm_MsgFt" style="text-align: right;"><span id="MVF1773025" style="white-space: nowrap;"></span></td>
										</tr>
									</tbody></table></td>
								</tr>
							</tbody></table></td>
						</tr>
					</tbody></table></td>
				</tr><tr class="Quick">
					<td class="Frm_MsgRtDivide"><img src="evtvwr.aspx_files/t_002.gif" alt="" width="1" border="0" height="1"></td>
				</tr>
<!-- Start Message head -->

				<tr class="MsgHd Rt HdUnSel" id="F1554680_h0">
					<td width="100%"><table class="QuickHd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" width="16"><a name="xx1554680xx"></a><img src="evtvwr.aspx_files/msg_general.gif" alt="General" width="16" align="top" height="16"></td><td class="Frm_MsgSubject"><a id="DynMessLink" name="1554680" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;noise=3&amp;sort=Position&amp;view=Quick&amp;select=1554680#xx1554680xx">Logging Source Not Available</a></td><td style="width: 20px; white-space: nowrap;"><img src="evtvwr.aspx_files/member_sm.gif" title="member" alt="member" border="0" height="16"></td><td class="Frm_MsgAuthor"><a href="http://www.codeproject.com/script/Membership/Profiles.aspx?mid=864684">rodneyhb</a></td><td class="Frm_MsgDate" style="vertical-align: top; white-space: nowrap;">6:57 29 Jun '06 &nbsp;</td>
						</tr>
					</tbody></table></td>
				</tr><!-- End Message head -->

				<tr id="F1554680_h1" style="display: none;">
					<td width="100%"><table class="QuickBd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" style="width: 16px;"><img src="evtvwr.aspx_files/t_002.gif" alt="" width="16" height="1"></td><td class="MsgBd BdSel"><table width="100%" border="0" cellpadding="0" cellspacing="5">
								<tbody><tr>
									<td><table width="100%" border="0" cellpadding="0" cellspacing="0">
										<tbody><tr>
											<td colspan="2">I
want to run an application that is extracted by an installer, executed
and removed by the installer upon completion. In this scenario the
source of the messages is not available after the application has
executed. Because of this I get errors in the event viewer stating that
the SOURCE could not be located. Is there a way to log messages to the
event viewer in this scenario? Is there a default SOURCE that I can
use? <br></td>
										</tr><tr style="vertical-align: middle;">
											<td class="Frm_MsgFt"><a class="Frm_MHL" href="http://www.codeproject.com/script/Membership/LogOn.aspx?rp=%2fKB%2fdotnet%2fevtvwr.aspx">Sign In</a>·<a class="Frm_MHL" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;sort=Position&amp;tid=1554680" title="View Thread">View Thread</a>·<a class="Frm_MHL" href="http://www.codeproject.com/script/Forums/View.aspx?fid=15511&amp;msg=1554680" title="Get permanent link">PermaLink</a></td><td class="Frm_MsgFt" style="text-align: right;"><span id="MVF1554680" style="white-space: nowrap;"></span></td>
										</tr>
									</tbody></table></td>
								</tr>
							</tbody></table></td>
						</tr>
					</tbody></table></td>
				</tr><tr class="Quick">
					<td class="Frm_MsgRtDivide"><img src="evtvwr.aspx_files/t_002.gif" alt="" width="1" border="0" height="1"></td>
				</tr>
<!-- Start Message head -->

				<tr class="MsgHd Rt HdUnSel" id="F1476596_h0">
					<td width="100%"><table class="QuickHd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" width="16"><a name="xx1476596xx"></a><img src="evtvwr.aspx_files/msg_question.gif" alt="Question" width="16" align="top" height="16"></td><td class="Frm_MsgSubject"><a id="DynMessLink" name="1476596" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;noise=3&amp;sort=Position&amp;view=Quick&amp;select=1476596#xx1476596xx">Category is not resolved until restart</a></td><td style="width: 20px; white-space: nowrap;"><img src="evtvwr.aspx_files/member_sm.gif" title="member" alt="member" border="0" height="16"></td><td class="Frm_MsgAuthor"><a href="http://www.codeproject.com/script/Membership/Profiles.aspx?mid=1344454">RomanI</a></td><td class="Frm_MsgDate" style="vertical-align: top; white-space: nowrap;">5:47 6 May '06 &nbsp;</td>
						</tr>
					</tbody></table></td>
				</tr><!-- End Message head -->

				<tr id="F1476596_h1" style="display: none;">
					<td width="100%"><table class="QuickBd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" style="width: 16px;"><img src="evtvwr.aspx_files/t_002.gif" alt="" width="16" height="1"></td><td class="MsgBd BdSel"><table width="100%" border="0" cellpadding="0" cellspacing="5">
								<tbody><tr>
									<td><table width="100%" border="0" cellpadding="0" cellspacing="0">
										<tbody><tr>
											<td colspan="2">Category names is not resolved until restart. And displayed as "(1)".<br>Please let help somebody who overcome this problem. <br></td>
										</tr><tr style="vertical-align: middle;">
											<td class="Frm_MsgFt"><a class="Frm_MHL" href="http://www.codeproject.com/script/Membership/LogOn.aspx?rp=%2fKB%2fdotnet%2fevtvwr.aspx">Sign In</a>·<a class="Frm_MHL" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;sort=Position&amp;tid=1476596" title="View Thread">View Thread</a>·<a class="Frm_MHL" href="http://www.codeproject.com/script/Forums/View.aspx?fid=15511&amp;msg=1476596" title="Get permanent link">PermaLink</a></td><td class="Frm_MsgFt" style="text-align: right;"><span id="MVF1476596" style="white-space: nowrap;"></span></td>
										</tr>
									</tbody></table></td>
								</tr>
							</tbody></table></td>
						</tr>
					</tbody></table></td>
				</tr><tr class="Quick">
					<td class="Frm_MsgRtDivide"><img src="evtvwr.aspx_files/t_002.gif" alt="" width="1" border="0" height="1"></td>
				</tr>
<!-- Start Message head -->

				<tr class="MsgHd HiVote Rt HdUnSel" id="F1387413_h0">
					<td width="100%"><table class="QuickHd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" width="16"><a name="xx1387413xx"></a><img src="evtvwr.aspx_files/msg_general.gif" alt="General" width="16" align="top" height="16"></td><td class="Frm_MsgSubject"><a id="DynMessLink" name="1387413" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;noise=3&amp;sort=Position&amp;view=Quick&amp;select=1387413#xx1387413xx">How can I log the user in the Event Log message?</a></td><td style="width: 20px; white-space: nowrap;"><img src="evtvwr.aspx_files/member_sm.gif" title="member" alt="member" border="0" height="16"></td><td class="Frm_MsgAuthor"><a href="http://www.codeproject.com/script/Membership/Profiles.aspx?mid=25061">Angel_Komarov</a></td><td class="Frm_MsgDate" style="vertical-align: top; white-space: nowrap;">15:20 27 Feb '06 &nbsp;</td>
						</tr>
					</tbody></table></td>
				</tr><!-- End Message head -->

				<tr id="F1387413_h1" style="display: none;">
					<td width="100%"><table class="QuickBd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" style="width: 16px;"><img src="evtvwr.aspx_files/t_002.gif" alt="" width="16" height="1"></td><td class="MsgBd BdSel"><table width="100%" border="0" cellpadding="0" cellspacing="5">
								<tbody><tr>
									<td><table width="100%" border="0" cellpadding="0" cellspacing="0">
										<tbody><tr>
											<td colspan="2">In Figures 4,5 in your article the user is marked as N/A. Is there a way to show the actual program’s user name there? <br><br>ak<br></td>
										</tr><tr style="vertical-align: middle;">
											<td class="Frm_MsgFt"><a class="Frm_MHL" href="http://www.codeproject.com/script/Membership/LogOn.aspx?rp=%2fKB%2fdotnet%2fevtvwr.aspx">Sign In</a>·<a class="Frm_MHL" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;sort=Position&amp;tid=1387413" title="View Thread">View Thread</a>·<a class="Frm_MHL" href="http://www.codeproject.com/script/Forums/View.aspx?fid=15511&amp;msg=1387413" title="Get permanent link">PermaLink</a></td><td class="Frm_MsgFt" style="text-align: right;"><span id="MVF1387413" style="white-space: nowrap;">5.00/5 (2 votes) </span></td>
										</tr>
									</tbody></table></td>
								</tr>
							</tbody></table></td>
						</tr>
					</tbody></table></td>
				</tr><tr class="Quick">
					<td class="Frm_MsgDivide"><img src="evtvwr.aspx_files/t_002.gif" alt="" width="1" border="0" height="1"></td>
				</tr>
<!-- Start Message head -->

				<tr class="MsgHd HdUnSel" id="F2288995_h0">
					<td width="100%"><table class="QuickHd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" width="34"><a name="xx2288995xx"></a><img src="evtvwr.aspx_files/msg_general.gif" alt="General" width="16" align="top" height="16"></td><td class="Frm_MsgSubject"><a id="DynMessLink" name="2288995" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;noise=3&amp;sort=Position&amp;view=Quick&amp;select=2288995#xx2288995xx">Re: How can I log the user in the Event Log message?</a></td><td style="width: 20px; white-space: nowrap;"><img src="evtvwr.aspx_files/member_sm.gif" title="member" alt="member" border="0" height="16"></td><td class="Frm_MsgAuthor"><a href="http://www.codeproject.com/script/Membership/Profiles.aspx?mid=537461">m_p_1971</a></td><td class="Frm_MsgDate" style="vertical-align: top; white-space: nowrap;">11:23 25 Oct '07 &nbsp;</td>
						</tr>
					</tbody></table></td>
				</tr><!-- End Message head -->

				<tr id="F2288995_h1" style="display: none;">
					<td width="100%"><table class="QuickBd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" style="width: 34px;"><img src="evtvwr.aspx_files/t_002.gif" alt="" width="34" height="1"></td><td class="MsgBd BdSel"><table width="100%" border="0" cellpadding="0" cellspacing="5">
								<tbody><tr>
									<td><table width="100%" border="0" cellpadding="0" cellspacing="0">
										<tbody><tr>
											<td colspan="2">A solution would be using Win32 ReportEvent. Couldn't find anything in .NET. Hope it helps. <br></td>
										</tr><tr style="vertical-align: middle;">
											<td class="Frm_MsgFt"><a class="Frm_MHL" href="http://www.codeproject.com/script/Membership/LogOn.aspx?rp=%2fKB%2fdotnet%2fevtvwr.aspx">Sign In</a>·<a class="Frm_MHL" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;sort=Position&amp;tid=1387413" title="View Thread">View Thread</a>·<a class="Frm_MHL" href="http://www.codeproject.com/script/Forums/View.aspx?fid=15511&amp;msg=2288995" title="Get permanent link">PermaLink</a></td><td class="Frm_MsgFt" style="text-align: right;"><span id="MVF2288995" style="white-space: nowrap;"></span></td>
										</tr>
									</tbody></table></td>
								</tr>
							</tbody></table></td>
						</tr>
					</tbody></table></td>
				</tr><tr class="Quick">
					<td class="Frm_MsgRtDivide"><img src="evtvwr.aspx_files/t_002.gif" alt="" width="1" border="0" height="1"></td>
				</tr>
<!-- Start Message head -->

				<tr class="MsgHd Rt HdUnSel" id="F1338258_h0">
					<td width="100%"><table class="QuickHd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" width="16"><a name="xx1338258xx"></a><img src="evtvwr.aspx_files/msg_question.gif" alt="Question" width="16" align="top" height="16"></td><td class="Frm_MsgSubject"><a id="DynMessLink" name="1338258" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;noise=3&amp;sort=Position&amp;view=Quick&amp;select=1338258#xx1338258xx">Problem with Event Id</a></td><td style="width: 20px; white-space: nowrap;"><img src="evtvwr.aspx_files/member_sm.gif" title="member" alt="member" border="0" height="16"></td><td class="Frm_MsgAuthor"><a href="http://www.codeproject.com/script/Membership/Profiles.aspx?mid=2532727">Hernan Alonso</a></td><td class="Frm_MsgDate" style="vertical-align: top; white-space: nowrap;">8:47 17 Jan '06 &nbsp;</td>
						</tr>
					</tbody></table></td>
				</tr><!-- End Message head -->

				<tr id="F1338258_h1" style="display: none;">
					<td width="100%"><table class="QuickBd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" style="width: 16px;"><img src="evtvwr.aspx_files/t_002.gif" alt="" width="16" height="1"></td><td class="MsgBd BdSel"><table width="100%" border="0" cellpadding="0" cellspacing="5">
								<tbody><tr>
									<td><table width="100%" border="0" cellpadding="0" cellspacing="0">
										<tbody><tr>
											<td colspan="2">Hello<br><br>I has problems using the object EventLog. When I read the object the EventId does not correspond with the real log.<br>The object retourn 3221226502 and it souhld be 1030.<br>Could be an error in my code or a bug?<br><br>Thanks!<br><br>Here is my code<br><br>        Dim myNewLog As New EventLog()<br>        'Set type of log (system, security, application)<br>        myNewLog.Log = type_log.ToString 'Application<br>        Dim entry As EventLogEntry<br>        Dim i As Integer = 0<br>        Dim HasData As Boolean = False<br>        ReDim ValuesLog(0)<br><br>        'Shearch information for the Log <br>        For Each entry In myNewLog.Entries<br><br>            ReDim Preserve ValuesLog(i)<br>            ValuesLog(i) = New String(7) {"", "", "", "", "", "", "", ""}<br>            'Check the last time of execution and takes the new ones for don't repeat this information in the DB<br>            If lasttime &lt;= entry.TimeGenerated Then<br><br>                HasData = True<br>                ReDim Preserve ValuesOS(UBound(ValuesOS, 1))(4)<br>                'insert Information for each Field<br>                ValuesLog(i)(0) = entry.EntryType<br>                ValuesLog(i)(1) = Format(CDate(entry.TimeGenerated), "yyyy-MM-dd H:mm:ss")<br>                ValuesLog(i)(2) = entry.Source<br><br>                ValuesLog(i)(3) = entry.Category<br>                ValuesLog(i)(4) = entry.EventID<br>                ValuesLog(i)(4) = entry.InstanceId.ToString<br><br>                If entry.UserName = "" Then<br>                    ValuesLog(i)(5) = "N/A"<br>                Else<br>                    ValuesLog(i)(5) = entry.UserName<br>                End If<br><br>                ValuesLog(i)(6) = entry.MachineName<br>                ValuesLog(i)(7) = entry.Message<br>                i = i + 1<br>            End If<br>        Next entry <br><br>Hernan Alonso<br><br></td>
										</tr><tr style="vertical-align: middle;">
											<td class="Frm_MsgFt"><a class="Frm_MHL" href="http://www.codeproject.com/script/Membership/LogOn.aspx?rp=%2fKB%2fdotnet%2fevtvwr.aspx">Sign In</a>·<a class="Frm_MHL" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;sort=Position&amp;tid=1338258" title="View Thread">View Thread</a>·<a class="Frm_MHL" href="http://www.codeproject.com/script/Forums/View.aspx?fid=15511&amp;msg=1338258" title="Get permanent link">PermaLink</a></td><td class="Frm_MsgFt" style="text-align: right;"><span id="MVF1338258" style="white-space: nowrap;"></span></td>
										</tr>
									</tbody></table></td>
								</tr>
							</tbody></table></td>
						</tr>
					</tbody></table></td>
				</tr><tr class="Quick">
					<td class="Frm_MsgDivide"><img src="evtvwr.aspx_files/t_002.gif" alt="" width="1" border="0" height="1"></td>
				</tr>
<!-- Start Message head -->

				<tr class="MsgHd HdUnSel" id="F2055792_h0">
					<td width="100%"><table class="QuickHd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" width="34"><a name="xx2055792xx"></a><img src="evtvwr.aspx_files/msg_answer.gif" alt="Answer" width="16" align="top" height="16"></td><td class="Frm_MsgSubject"><a id="DynMessLink" name="2055792" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;noise=3&amp;sort=Position&amp;view=Quick&amp;select=2055792#xx2055792xx">Re: Problem with Event Id</a></td><td style="width: 20px; white-space: nowrap;"><img src="evtvwr.aspx_files/member_sm.gif" title="member" alt="member" border="0" height="16"></td><td class="Frm_MsgAuthor"><a href="http://www.codeproject.com/script/Membership/Profiles.aspx?mid=4174342">Raul Jose</a></td><td class="Frm_MsgDate" style="vertical-align: top; white-space: nowrap;">19:09 27 May '07 &nbsp;</td>
						</tr>
					</tbody></table></td>
				</tr><!-- End Message head -->

				<tr id="F2055792_h1" style="display: none;">
					<td width="100%"><table class="QuickBd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" style="width: 34px;"><img src="evtvwr.aspx_files/t_002.gif" alt="" width="34" height="1"></td><td class="MsgBd BdSel"><table width="100%" border="0" cellpadding="0" cellspacing="5">
								<tbody><tr>
									<td><table width="100%" border="0" cellpadding="0" cellspacing="0">
										<tbody><tr>
											<td colspan="2">hi Hernan<br>I am also facing the same problem.<br>Actually, I am not able to find the solution.<br>I see, that you posted it last year.<br><br>I wanna ask, whether you've find the solution?<br><br>If yes, then please help me out... how to get the actual event id<br><br>(the only work-around i could get was...<br>. get that 10 digit number and convert it to binary...<br>. trim the binary number and store only last 16 bits.<br>. again convert those 16-bit number in decimal.<br>we get the required number shown in event viewer...)<br><br>but the main problem arives when I've to search the eventlog entries<br>quering on the basis of event id.<br>(I think need to get 10-digit number from 4 digit number here... but how?)<br><br>let me know if you get the solution.<br><br>Thanks<br>Raul <br></td>
										</tr><tr style="vertical-align: middle;">
											<td class="Frm_MsgFt"><a class="Frm_MHL" href="http://www.codeproject.com/script/Membership/LogOn.aspx?rp=%2fKB%2fdotnet%2fevtvwr.aspx">Sign In</a>·<a class="Frm_MHL" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;sort=Position&amp;tid=1338258" title="View Thread">View Thread</a>·<a class="Frm_MHL" href="http://www.codeproject.com/script/Forums/View.aspx?fid=15511&amp;msg=2055792" title="Get permanent link">PermaLink</a></td><td class="Frm_MsgFt" style="text-align: right;"><span id="MVF2055792" style="white-space: nowrap;"></span></td>
										</tr>
									</tbody></table></td>
								</tr>
							</tbody></table></td>
						</tr>
					</tbody></table></td>
				</tr><tr class="Quick">
					<td class="Frm_MsgDivide"><img src="evtvwr.aspx_files/t_002.gif" alt="" width="1" border="0" height="1"></td>
				</tr>
<!-- Start Message head -->

				<tr class="MsgHd HdUnSel" id="F2069148_h0">
					<td width="100%"><table class="QuickHd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" width="52"><a name="xx2069148xx"></a><img src="evtvwr.aspx_files/msg_general.gif" alt="General" width="16" align="top" height="16"></td><td class="Frm_MsgSubject"><a id="DynMessLink" name="2069148" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;noise=3&amp;sort=Position&amp;view=Quick&amp;select=2069148#xx2069148xx">Re: Problem with Event Id</a></td><td style="width: 20px; white-space: nowrap;"><img src="evtvwr.aspx_files/member_sm.gif" title="member" alt="member" border="0" height="16"></td><td class="Frm_MsgAuthor"><a href="http://www.codeproject.com/script/Membership/Profiles.aspx?mid=4205791">Anna Ellis</a></td><td class="Frm_MsgDate" style="vertical-align: top; white-space: nowrap;">2:26 6 Jun '07 &nbsp;</td>
						</tr>
					</tbody></table></td>
				</tr><!-- End Message head -->

				<tr id="F2069148_h1" style="display: none;">
					<td width="100%"><table class="QuickBd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" style="width: 52px;"><img src="evtvwr.aspx_files/t_002.gif" alt="" width="52" height="1"></td><td class="MsgBd BdSel"><table width="100%" border="0" cellpadding="0" cellspacing="5">
								<tbody><tr>
									<td><table width="100%" border="0" cellpadding="0" cellspacing="0">
										<tbody><tr>
											<td colspan="2">Raul,<br><br>Taking as an example:<br><br>MSSQLSERVER Server Event ID 3221229486 <br><br>This = Error 4014 <br><br>3221229486 converted to binary = 11000000000000000000111110101110 (Qword/Dword)<br>11000000000000000000111110101110 reduces to binary 111110101110 (Word)<br>111110101110 converts to decimal 4014.<br><br>To reverse:<br><br>4014 converts to 111110101110 binary (Word)<br>Add 11000000000000000000000000000000 (32 digits, Qword/Dword)<br>This gives 11000000000000000000111110101110 which converts to decimal 3221229486<br><br>HTH<br><br>Anna <br></td>
										</tr><tr style="vertical-align: middle;">
											<td class="Frm_MsgFt"><a class="Frm_MHL" href="http://www.codeproject.com/script/Membership/LogOn.aspx?rp=%2fKB%2fdotnet%2fevtvwr.aspx">Sign In</a>·<a class="Frm_MHL" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;sort=Position&amp;tid=1338258" title="View Thread">View Thread</a>·<a class="Frm_MHL" href="http://www.codeproject.com/script/Forums/View.aspx?fid=15511&amp;msg=2069148" title="Get permanent link">PermaLink</a></td><td class="Frm_MsgFt" style="text-align: right;"><span id="MVF2069148" style="white-space: nowrap;"></span></td>
										</tr>
									</tbody></table></td>
								</tr>
							</tbody></table></td>
						</tr>
					</tbody></table></td>
				</tr><tr class="Quick">
					<td class="Frm_MsgRtDivide"><img src="evtvwr.aspx_files/t_002.gif" alt="" width="1" border="0" height="1"></td>
				</tr>
<!-- Start Message head -->

				<tr class="MsgHd HiVote Rt HdUnSel" id="F1245034_h0">
					<td width="100%"><table class="QuickHd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" width="16"><a name="xx1245034xx"></a><img src="evtvwr.aspx_files/msg_question.gif" alt="Question" width="16" align="top" height="16"></td><td class="Frm_MsgSubject"><a id="DynMessLink" name="1245034" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;noise=3&amp;sort=Position&amp;view=Quick&amp;select=1245034#xx1245034xx">Help with the hyperlinks</a></td><td style="width: 20px; white-space: nowrap;"><img src="evtvwr.aspx_files/member_sm.gif" title="member" alt="member" border="0" height="16"></td><td class="Frm_MsgAuthor"><a href="http://www.codeproject.com/script/Membership/Profiles.aspx?mid=154017">David Hoyt</a></td><td class="Frm_MsgDate" style="vertical-align: top; white-space: nowrap;">12:12 4 Oct '05 &nbsp;</td>
						</tr>
					</tbody></table></td>
				</tr><!-- End Message head -->

				<tr id="F1245034_h1" style="display: none;">
					<td width="100%"><table class="QuickBd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" style="width: 16px;"><img src="evtvwr.aspx_files/t_002.gif" alt="" width="16" height="1"></td><td class="MsgBd BdSel"><table width="100%" border="0" cellpadding="0" cellspacing="5">
								<tbody><tr>
									<td><table width="100%" border="0" cellpadding="0" cellspacing="0">
										<tbody><tr>
											<td colspan="2">Could
you please post how you created a hyperlink in the event log message? I
tried using just a hyperlink, RTF, hyperlinks with anchor tags, etc.
and I got nothing. Please help! Other people have asked and you have
remained silent. Thanks for helping out! (c: <br></td>
										</tr><tr style="vertical-align: middle;">
											<td class="Frm_MsgFt"><a class="Frm_MHL" href="http://www.codeproject.com/script/Membership/LogOn.aspx?rp=%2fKB%2fdotnet%2fevtvwr.aspx">Sign In</a>·<a class="Frm_MHL" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;sort=Position&amp;tid=1245034" title="View Thread">View Thread</a>·<a class="Frm_MHL" href="http://www.codeproject.com/script/Forums/View.aspx?fid=15511&amp;msg=1245034" title="Get permanent link">PermaLink</a></td><td class="Frm_MsgFt" style="text-align: right;"><span id="MVF1245034" style="white-space: nowrap;">5.00/5 (1 vote) </span></td>
										</tr>
									</tbody></table></td>
								</tr>
							</tbody></table></td>
						</tr>
					</tbody></table></td>
				</tr><tr class="Quick">
					<td class="Frm_MsgRtDivide"><img src="evtvwr.aspx_files/t_002.gif" alt="" width="1" border="0" height="1"></td>
				</tr>
<!-- Start Message head -->

				<tr class="MsgHd Rt HdUnSel" id="F1131385_h0">
					<td width="100%"><table class="QuickHd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" width="16"><a name="xx1131385xx"></a><img src="evtvwr.aspx_files/msg_general.gif" alt="General" width="16" align="top" height="16"></td><td class="Frm_MsgSubject"><a id="DynMessLink" name="1131385" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;noise=3&amp;sort=Position&amp;view=Quick&amp;select=1131385#xx1131385xx">Oscar Rodriguez Question??</a></td><td style="width: 20px; white-space: nowrap;"><img src="evtvwr.aspx_files/member_sm.gif" title="member" alt="member" border="0" height="16"></td><td class="Frm_MsgAuthor"><a href="http://www.codeproject.com/script/Membership/Profiles.aspx?mid=2017356">Oscaritoheroes</a></td><td class="Frm_MsgDate" style="vertical-align: top; white-space: nowrap;">9:28 9 Jun '05 &nbsp;</td>
						</tr>
					</tbody></table></td>
				</tr><!-- End Message head -->

				<tr id="F1131385_h1" style="display: none;">
					<td width="100%"><table class="QuickBd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" style="width: 16px;"><img src="evtvwr.aspx_files/t_002.gif" alt="" width="16" height="1"></td><td class="MsgBd BdSel"><table width="100%" border="0" cellpadding="0" cellspacing="5">
								<tbody><tr>
									<td><table width="100%" border="0" cellpadding="0" cellspacing="0">
										<tbody><tr>
											<td colspan="2">Hello Manoj G<br><br>Sorry for my english,I readed your article is much interesting! <br><br>I check to the EventLog Class in .NET,I can delete all Entrys at one Event Log but...<br>Who can I delete one Entry in one specific event Log?<br><br>Tank's. <br></td>
										</tr><tr style="vertical-align: middle;">
											<td class="Frm_MsgFt"><a class="Frm_MHL" href="http://www.codeproject.com/script/Membership/LogOn.aspx?rp=%2fKB%2fdotnet%2fevtvwr.aspx">Sign In</a>·<a class="Frm_MHL" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;sort=Position&amp;tid=1131385" title="View Thread">View Thread</a>·<a class="Frm_MHL" href="http://www.codeproject.com/script/Forums/View.aspx?fid=15511&amp;msg=1131385" title="Get permanent link">PermaLink</a></td><td class="Frm_MsgFt" style="text-align: right;"><span id="MVF1131385" style="white-space: nowrap;"></span></td>
										</tr>
									</tbody></table></td>
								</tr>
							</tbody></table></td>
						</tr>
					</tbody></table></td>
				</tr><tr class="Quick">
					<td class="Frm_MsgRtDivide"><img src="evtvwr.aspx_files/t_002.gif" alt="" width="1" border="0" height="1"></td>
				</tr>
<!-- Start Message head -->

				<tr class="MsgHd LoVote Rt HdUnSel" id="F1033806_h0">
					<td width="100%"><table class="QuickHd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" width="16"><a name="xx1033806xx"></a><img src="evtvwr.aspx_files/msg_general.gif" alt="General" width="16" align="top" height="16"></td><td class="Frm_MsgSubject"><a id="DynMessLink" name="1033806" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;noise=3&amp;sort=Position&amp;view=Quick&amp;select=1033806#xx1033806xx">Category is always showing (1)</a></td><td style="width: 20px; white-space: nowrap;"><img src="evtvwr.aspx_files/usersuss.gif" alt="suss" width="14" height="15"></td><td class="Frm_MsgAuthor">Anonymous</td><td class="Frm_MsgDate" style="vertical-align: top; white-space: nowrap;">19:10 7 Feb '05 &nbsp;</td>
						</tr>
					</tbody></table></td>
				</tr><!-- End Message head -->

				<tr id="F1033806_h1" style="display: none;">
					<td width="100%"><table class="QuickBd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" style="width: 16px;"><img src="evtvwr.aspx_files/t_002.gif" alt="" width="16" height="1"></td><td class="MsgBd BdSel"><table width="100%" border="0" cellpadding="0" cellspacing="5">
								<tbody><tr>
									<td><table width="100%" border="0" cellpadding="0" cellspacing="0">
										<tbody><tr>
											<td colspan="2">When I tried to an write to into eventlog everything is coming fine except the category. It is showing (1). How can I solve it. <br></td>
										</tr><tr style="vertical-align: middle;">
											<td class="Frm_MsgFt"><a class="Frm_MHL" href="http://www.codeproject.com/script/Membership/LogOn.aspx?rp=%2fKB%2fdotnet%2fevtvwr.aspx">Sign In</a>·<a class="Frm_MHL" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;sort=Position&amp;tid=1033806" title="View Thread">View Thread</a>·<a class="Frm_MHL" href="http://www.codeproject.com/script/Forums/View.aspx?fid=15511&amp;msg=1033806" title="Get permanent link">PermaLink</a></td><td class="Frm_MsgFt" style="text-align: right;"><span id="MVF1033806" style="white-space: nowrap;">2.00/5 (1 vote) </span></td>
										</tr>
									</tbody></table></td>
								</tr>
							</tbody></table></td>
						</tr>
					</tbody></table></td>
				</tr><tr class="Quick">
					<td class="Frm_MsgDivide"><img src="evtvwr.aspx_files/t_002.gif" alt="" width="1" border="0" height="1"></td>
				</tr>
<!-- Start Message head -->

				<tr class="MsgHd HdUnSel" id="F1410049_h0">
					<td width="100%"><table class="QuickHd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" width="34"><a name="xx1410049xx"></a><img src="evtvwr.aspx_files/msg_general.gif" alt="General" width="16" align="top" height="16"></td><td class="Frm_MsgSubject"><a id="DynMessLink" name="1410049" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;noise=3&amp;sort=Position&amp;view=Quick&amp;select=1410049#xx1410049xx">Re: Category is always showing (1)</a></td><td style="width: 20px; white-space: nowrap;"><img src="evtvwr.aspx_files/member_sm.gif" title="member" alt="member" border="0" height="16"></td><td class="Frm_MsgAuthor"><a href="http://www.codeproject.com/script/Membership/Profiles.aspx?mid=2131279">thecodeprojectsux</a></td><td class="Frm_MsgDate" style="vertical-align: top; white-space: nowrap;">23:36 15 Mar '06 &nbsp;</td>
						</tr>
					</tbody></table></td>
				</tr><!-- End Message head -->

				<tr id="F1410049_h1" style="display: none;">
					<td width="100%"><table class="QuickBd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" style="width: 34px;"><img src="evtvwr.aspx_files/t_002.gif" alt="" width="34" height="1"></td><td class="MsgBd BdSel"><table width="100%" border="0" cellpadding="0" cellspacing="5">
								<tbody><tr>
									<td><table width="100%" border="0" cellpadding="0" cellspacing="0">
										<tbody><tr>
											<td colspan="2">Had
exactly the same problem but it was because the source wasn't pointing
to the dll correctly. The screenshots above show the registry keys
being added under MySource2 but then all the code references MySource1.
Just duplicate the reg keys under all the sources and it works fine. <br><br>Great article by the way. <br></td>
										</tr><tr style="vertical-align: middle;">
											<td class="Frm_MsgFt"><a class="Frm_MHL" href="http://www.codeproject.com/script/Membership/LogOn.aspx?rp=%2fKB%2fdotnet%2fevtvwr.aspx">Sign In</a>·<a class="Frm_MHL" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;sort=Position&amp;tid=1033806" title="View Thread">View Thread</a>·<a class="Frm_MHL" href="http://www.codeproject.com/script/Forums/View.aspx?fid=15511&amp;msg=1410049" title="Get permanent link">PermaLink</a></td><td class="Frm_MsgFt" style="text-align: right;"><span id="MVF1410049" style="white-space: nowrap;"></span></td>
										</tr>
									</tbody></table></td>
								</tr>
							</tbody></table></td>
						</tr>
					</tbody></table></td>
				</tr><tr class="Quick">
					<td class="Frm_MsgRtDivide"><img src="evtvwr.aspx_files/t_002.gif" alt="" width="1" border="0" height="1"></td>
				</tr>
<!-- Start Message head -->

				<tr class="MsgHd Rt HdUnSel" id="F981024_h0">
					<td width="100%"><table class="QuickHd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" width="16"><a name="xx981024xx"></a><img src="evtvwr.aspx_files/msg_general.gif" alt="General" width="16" align="top" height="16"></td><td class="Frm_MsgSubject"><a id="DynMessLink" name="981024" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;noise=3&amp;sort=Position&amp;view=Quick&amp;select=981024#xx981024xx">Providing links in error messages</a></td><td style="width: 20px; white-space: nowrap;"><img src="evtvwr.aspx_files/usersuss.gif" alt="suss" width="14" height="15"></td><td class="Frm_MsgAuthor">BuddyWork</td><td class="Frm_MsgDate" style="vertical-align: top; white-space: nowrap;">22:26 24 Nov '04 &nbsp;</td>
						</tr>
					</tbody></table></td>
				</tr><!-- End Message head -->

				<tr id="F981024_h1" style="display: none;">
					<td width="100%"><table class="QuickBd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" style="width: 16px;"><img src="evtvwr.aspx_files/t_002.gif" alt="" width="16" height="1"></td><td class="MsgBd BdSel"><table width="100%" border="0" cellpadding="0" cellspacing="5">
								<tbody><tr>
									<td><table width="100%" border="0" cellpadding="0" cellspacing="0">
										<tbody><tr>
											<td colspan="2">You mention that you can add a link in the error message. How do you go about doing this?<br><br>Thanks,<img src="evtvwr.aspx_files/smiley_biggrin.gif" alt="Big Grin" align="top"> <br></td>
										</tr><tr style="vertical-align: middle;">
											<td class="Frm_MsgFt"><a class="Frm_MHL" href="http://www.codeproject.com/script/Membership/LogOn.aspx?rp=%2fKB%2fdotnet%2fevtvwr.aspx">Sign In</a>·<a class="Frm_MHL" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;sort=Position&amp;tid=981024" title="View Thread">View Thread</a>·<a class="Frm_MHL" href="http://www.codeproject.com/script/Forums/View.aspx?fid=15511&amp;msg=981024" title="Get permanent link">PermaLink</a></td><td class="Frm_MsgFt" style="text-align: right;"><span id="MVF981024" style="white-space: nowrap;"></span></td>
										</tr>
									</tbody></table></td>
								</tr>
							</tbody></table></td>
						</tr>
					</tbody></table></td>
				</tr><tr class="Quick">
					<td class="Frm_MsgRtDivide"><img src="evtvwr.aspx_files/t_002.gif" alt="" width="1" border="0" height="1"></td>
				</tr>
<!-- Start Message head -->

				<tr class="MsgHd Rt HdUnSel" id="F975439_h0">
					<td width="100%"><table class="QuickHd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" width="16"><a name="xx975439xx"></a><img src="evtvwr.aspx_files/msg_general.gif" alt="General" width="16" align="top" height="16"></td><td class="Frm_MsgSubject"><a id="DynMessLink" name="975439" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;noise=3&amp;sort=Position&amp;view=Quick&amp;select=975439#xx975439xx">Query the Event Viewer</a></td><td style="width: 20px; white-space: nowrap;"><img src="evtvwr.aspx_files/usersuss.gif" alt="suss" width="14" height="15"></td><td class="Frm_MsgAuthor">Anonymous</td><td class="Frm_MsgDate" style="vertical-align: top; white-space: nowrap;">12:34 17 Nov '04 &nbsp;</td>
						</tr>
					</tbody></table></td>
				</tr><!-- End Message head -->

				<tr id="F975439_h1" style="display: none;">
					<td width="100%"><table class="QuickBd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" style="width: 16px;"><img src="evtvwr.aspx_files/t_002.gif" alt="" width="16" height="1"></td><td class="MsgBd BdSel"><table width="100%" border="0" cellpadding="0" cellspacing="5">
								<tbody><tr>
									<td><table width="100%" border="0" cellpadding="0" cellspacing="0">
										<tbody><tr>
											<td colspan="2"><img src="evtvwr.aspx_files/smiley_smile.gif" alt="Smile" align="top">Hi all,<br>I
was looking at the Event Viewer, but there are too many event logs, i
thought it would be a good idea somehow we can query and search for a
particular word or error.&nbsp;&nbsp; Any ideas?? <br></td>
										</tr><tr style="vertical-align: middle;">
											<td class="Frm_MsgFt"><a class="Frm_MHL" href="http://www.codeproject.com/script/Membership/LogOn.aspx?rp=%2fKB%2fdotnet%2fevtvwr.aspx">Sign In</a>·<a class="Frm_MHL" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;sort=Position&amp;tid=975439" title="View Thread">View Thread</a>·<a class="Frm_MHL" href="http://www.codeproject.com/script/Forums/View.aspx?fid=15511&amp;msg=975439" title="Get permanent link">PermaLink</a></td><td class="Frm_MsgFt" style="text-align: right;"><span id="MVF975439" style="white-space: nowrap;"></span></td>
										</tr>
									</tbody></table></td>
								</tr>
							</tbody></table></td>
						</tr>
					</tbody></table></td>
				</tr><tr class="Quick">
					<td class="Frm_MsgRtDivide"><img src="evtvwr.aspx_files/t_002.gif" alt="" width="1" border="0" height="1"></td>
				</tr>
<!-- Start Message head -->

				<tr class="MsgHd Rt HdUnSel" id="F900676_h0">
					<td width="100%"><table class="QuickHd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" width="16"><a name="xx900676xx"></a><img src="evtvwr.aspx_files/msg_general.gif" alt="General" width="16" align="top" height="16"></td><td class="Frm_MsgSubject"><a id="DynMessLink" name="900676" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;noise=3&amp;sort=Position&amp;view=Quick&amp;select=900676#xx900676xx">Hyperlinks in the error messages</a></td><td style="width: 20px; white-space: nowrap;"><img src="evtvwr.aspx_files/member_sm.gif" title="member" alt="member" border="0" height="16"></td><td class="Frm_MsgAuthor"><a href="http://www.codeproject.com/script/Membership/Profiles.aspx?mid=635461">Christian Eriksen</a></td><td class="Frm_MsgDate" style="vertical-align: top; white-space: nowrap;">16:50 17 Aug '04 &nbsp;</td>
						</tr>
					</tbody></table></td>
				</tr><!-- End Message head -->

				<tr id="F900676_h1" style="display: none;">
					<td width="100%"><table class="QuickBd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" style="width: 16px;"><img src="evtvwr.aspx_files/t_002.gif" alt="" width="16" height="1"></td><td class="MsgBd BdSel"><table width="100%" border="0" cellpadding="0" cellspacing="5">
								<tbody><tr>
									<td><table width="100%" border="0" cellpadding="0" cellspacing="0">
										<tbody><tr>
											<td colspan="2"><br>You mentioned in your <b>excellent</b>
article the Event Viewer's feature of providing hyperlinks in error
messages. Do you know the syntax that aplies to the messagestring in
order to display a hyperlink?<br><br>objEventLog.WriteEntry(strWithHyperlink, EventLogEntryType.Error, 1000, CShort(1))<br><br>Thanks,<br>Christian<br> <br></td>
										</tr><tr style="vertical-align: middle;">
											<td class="Frm_MsgFt"><a class="Frm_MHL" href="http://www.codeproject.com/script/Membership/LogOn.aspx?rp=%2fKB%2fdotnet%2fevtvwr.aspx">Sign In</a>·<a class="Frm_MHL" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;sort=Position&amp;tid=900676" title="View Thread">View Thread</a>·<a class="Frm_MHL" href="http://www.codeproject.com/script/Forums/View.aspx?fid=15511&amp;msg=900676" title="Get permanent link">PermaLink</a></td><td class="Frm_MsgFt" style="text-align: right;"><span id="MVF900676" style="white-space: nowrap;"></span></td>
										</tr>
									</tbody></table></td>
								</tr>
							</tbody></table></td>
						</tr>
					</tbody></table></td>
				</tr><tr class="Quick">
					<td class="Frm_MsgDivide"><img src="evtvwr.aspx_files/t_002.gif" alt="" width="1" border="0" height="1"></td>
				</tr>
<!-- Start Message head -->

				<tr class="MsgHd LoVote HdUnSel" id="F981025_h0">
					<td width="100%"><table class="QuickHd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" width="34"><a name="xx981025xx"></a><img src="evtvwr.aspx_files/msg_general.gif" alt="General" width="16" align="top" height="16"></td><td class="Frm_MsgSubject"><a id="DynMessLink" name="981025" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;noise=3&amp;sort=Position&amp;view=Quick&amp;select=981025#xx981025xx">Re: Hyperlinks in the error messages</a></td><td style="width: 20px; white-space: nowrap;"><img src="evtvwr.aspx_files/usersuss.gif" alt="suss" width="14" height="15"></td><td class="Frm_MsgAuthor">BuddyWork</td><td class="Frm_MsgDate" style="vertical-align: top; white-space: nowrap;">22:29 24 Nov '04 &nbsp;</td>
						</tr>
					</tbody></table></td>
				</tr><!-- End Message head -->

				<tr id="F981025_h1" style="display: none;">
					<td width="100%"><table class="QuickBd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" style="width: 34px;"><img src="evtvwr.aspx_files/t_002.gif" alt="" width="34" height="1"></td><td class="MsgBd BdSel"><table width="100%" border="0" cellpadding="0" cellspacing="5">
								<tbody><tr>
									<td><table width="100%" border="0" cellpadding="0" cellspacing="0">
										<tbody><tr>
											<td colspan="2">Did you work out how to do this?<big><img src="evtvwr.aspx_files/smiley_biggrin.gif" alt="Big Grin" align="top"></big> <br></td>
										</tr><tr style="vertical-align: middle;">
											<td class="Frm_MsgFt"><a class="Frm_MHL" href="http://www.codeproject.com/script/Membership/LogOn.aspx?rp=%2fKB%2fdotnet%2fevtvwr.aspx">Sign In</a>·<a class="Frm_MHL" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;sort=Position&amp;tid=900676" title="View Thread">View Thread</a>·<a class="Frm_MHL" href="http://www.codeproject.com/script/Forums/View.aspx?fid=15511&amp;msg=981025" title="Get permanent link">PermaLink</a></td><td class="Frm_MsgFt" style="text-align: right;"><span id="MVF981025" style="white-space: nowrap;">1.00/5 (1 vote) </span></td>
										</tr>
									</tbody></table></td>
								</tr>
							</tbody></table></td>
						</tr>
					</tbody></table></td>
				</tr><tr class="Quick">
					<td class="Frm_MsgDivide"><img src="evtvwr.aspx_files/t_002.gif" alt="" width="1" border="0" height="1"></td>
				</tr>
<!-- Start Message head -->

				<tr class="MsgHd HdUnSel" id="F2570913_h0">
					<td width="100%"><table class="QuickHd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" width="52"><a name="xx2570913xx"></a><img src="evtvwr.aspx_files/msg_general.gif" alt="General" width="16" align="top" height="16"></td><td class="Frm_MsgSubject"><a id="DynMessLink" name="2570913" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;noise=3&amp;sort=Position&amp;view=Quick&amp;select=2570913#xx2570913xx">Re: Hyperlinks in the error messages</a></td><td style="width: 20px; white-space: nowrap;"><img src="evtvwr.aspx_files/member_sm.gif" title="member" alt="member" border="0" height="16"></td><td class="Frm_MsgAuthor"><a href="http://www.codeproject.com/script/Membership/Profiles.aspx?mid=1799878">gntombel</a></td><td class="Frm_MsgDate" style="vertical-align: top; white-space: nowrap;">23:39 26 May '08 &nbsp;</td>
						</tr>
					</tbody></table></td>
				</tr><!-- End Message head -->

				<tr id="F2570913_h1" style="display: none;">
					<td width="100%"><table class="QuickBd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" style="width: 52px;"><img src="evtvwr.aspx_files/t_002.gif" alt="" width="52" height="1"></td><td class="MsgBd BdSel"><table width="100%" border="0" cellpadding="0" cellspacing="5">
								<tbody><tr>
									<td><table width="100%" border="0" cellpadding="0" cellspacing="0">
										<tbody><tr>
											<td colspan="2">Dis anyone get the hyper-links to work? <br></td>
										</tr><tr style="vertical-align: middle;">
											<td class="Frm_MsgFt"><a class="Frm_MHL" href="http://www.codeproject.com/script/Membership/LogOn.aspx?rp=%2fKB%2fdotnet%2fevtvwr.aspx">Sign In</a>·<a class="Frm_MHL" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;sort=Position&amp;tid=900676" title="View Thread">View Thread</a>·<a class="Frm_MHL" href="http://www.codeproject.com/script/Forums/View.aspx?fid=15511&amp;msg=2570913" title="Get permanent link">PermaLink</a></td><td class="Frm_MsgFt" style="text-align: right;"><span id="MVF2570913" style="white-space: nowrap;"></span></td>
										</tr>
									</tbody></table></td>
								</tr>
							</tbody></table></td>
						</tr>
					</tbody></table></td>
				</tr><tr class="Quick">
					<td class="Frm_MsgRtDivide"><img src="evtvwr.aspx_files/t_002.gif" alt="" width="1" border="0" height="1"></td>
				</tr>
<!-- Start Message head -->

				<tr class="MsgHd LoVote Rt HdUnSel" id="F865646_h0">
					<td width="100%"><table class="QuickHd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" width="16"><a name="xx865646xx"></a><img src="evtvwr.aspx_files/msg_general.gif" alt="General" width="16" align="top" height="16"></td><td class="Frm_MsgSubject"><a id="DynMessLink" name="865646" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;noise=3&amp;sort=Position&amp;view=Quick&amp;select=865646#xx865646xx">How to customize the event viewer?</a></td><td style="width: 20px; white-space: nowrap;"><img src="evtvwr.aspx_files/usersuss.gif" alt="suss" width="14" height="15"></td><td class="Frm_MsgAuthor">Anonymous</td><td class="Frm_MsgDate" style="vertical-align: top; white-space: nowrap;">10:56 1 Jul '04 &nbsp;</td>
						</tr>
					</tbody></table></td>
				</tr><!-- End Message head -->

				<tr id="F865646_h1" style="display: none;">
					<td width="100%"><table class="QuickBd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" style="width: 16px;"><img src="evtvwr.aspx_files/t_002.gif" alt="" width="16" height="1"></td><td class="MsgBd BdSel"><table width="100%" border="0" cellpadding="0" cellspacing="5">
								<tbody><tr>
									<td><table width="100%" border="0" cellpadding="0" cellspacing="0">
										<tbody><tr>
											<td colspan="2">This
is a great article, however, I was wondering if you guys can help me
with a related issue. I would like the event viewer snap-in to display
only my custom log, without Application, security, etc.<br><br>Any one knows how to do that?<br><br>Thanks,<br><br>Omer <br></td>
										</tr><tr style="vertical-align: middle;">
											<td class="Frm_MsgFt"><a class="Frm_MHL" href="http://www.codeproject.com/script/Membership/LogOn.aspx?rp=%2fKB%2fdotnet%2fevtvwr.aspx">Sign In</a>·<a class="Frm_MHL" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;sort=Position&amp;tid=865646" title="View Thread">View Thread</a>·<a class="Frm_MHL" href="http://www.codeproject.com/script/Forums/View.aspx?fid=15511&amp;msg=865646" title="Get permanent link">PermaLink</a></td><td class="Frm_MsgFt" style="text-align: right;"><span id="MVF865646" style="white-space: nowrap;">1.00/5 (1 vote) </span></td>
										</tr>
									</tbody></table></td>
								</tr>
							</tbody></table></td>
						</tr>
					</tbody></table></td>
				</tr><tr class="Quick">
					<td class="Frm_MsgDivide"><img src="evtvwr.aspx_files/t_002.gif" alt="" width="1" border="0" height="1"></td>
				</tr>
<!-- Start Message head -->

				<tr class="MsgHd LoVote HdUnSel" id="F929563_h0">
					<td width="100%"><table class="QuickHd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" width="34"><a name="xx929563xx"></a><img src="evtvwr.aspx_files/msg_general.gif" alt="General" width="16" align="top" height="16"></td><td class="Frm_MsgSubject"><a id="DynMessLink" name="929563" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;noise=3&amp;sort=Position&amp;view=Quick&amp;select=929563#xx929563xx">Re: How to customize the event viewer?</a></td><td style="width: 20px; white-space: nowrap;"><img src="evtvwr.aspx_files/member_sm.gif" title="member" alt="member" border="0" height="16"></td><td class="Frm_MsgAuthor"><a href="http://www.codeproject.com/script/Membership/Profiles.aspx?mid=115893">Alin Irimias</a></td><td class="Frm_MsgDate" style="vertical-align: top; white-space: nowrap;">23:17 20 Sep '04 &nbsp;</td>
						</tr>
					</tbody></table></td>
				</tr><!-- End Message head -->

				<tr id="F929563_h1" style="display: none;">
					<td width="100%"><table class="QuickBd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" style="width: 34px;"><img src="evtvwr.aspx_files/t_002.gif" alt="" width="34" height="1"></td><td class="MsgBd BdSel"><table width="100%" border="0" cellpadding="0" cellspacing="5">
								<tbody><tr>
									<td><table width="100%" border="0" cellpadding="0" cellspacing="0">
										<tbody><tr>
											<td colspan="2">It's simple <img src="evtvwr.aspx_files/smiley_smile.gif" alt="Smile" align="top"><br><br>1. Run mmc.exe<br>2. In the mmc select File\Add Remove Snap-in. That will open the "Add Remove Snap-in" dialog. Add the Event Viewer snap-in.<br>3.
Close the dialog and you'll have the event viewer snap-in open. Right
click your custom log node and select "New window from here". It will
open another window with just your custom log node. Now you can close
the old snap-in window.<br>4. Optional. Select File\Options and in the
Options dialog you can set a name for your mmc file and change the file
icon. You can also change the Console Mode to "User mode - limited
access, single window".<br>5. Save your console to a msc file. <br> <br></td>
										</tr><tr style="vertical-align: middle;">
											<td class="Frm_MsgFt"><a class="Frm_MHL" href="http://www.codeproject.com/script/Membership/LogOn.aspx?rp=%2fKB%2fdotnet%2fevtvwr.aspx">Sign In</a>·<a class="Frm_MHL" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;sort=Position&amp;tid=865646" title="View Thread">View Thread</a>·<a class="Frm_MHL" href="http://www.codeproject.com/script/Forums/View.aspx?fid=15511&amp;msg=929563" title="Get permanent link">PermaLink</a></td><td class="Frm_MsgFt" style="text-align: right;"><span id="MVF929563" style="white-space: nowrap;">2.00/5 (1 vote) </span></td>
										</tr>
									</tbody></table></td>
								</tr>
							</tbody></table></td>
						</tr>
					</tbody></table></td>
				</tr><tr class="Quick">
					<td class="Frm_MsgDivide"><img src="evtvwr.aspx_files/t_002.gif" alt="" width="1" border="0" height="1"></td>
				</tr>
<!-- Start Message head -->

				<tr class="MsgHd HdUnSel" id="F929565_h0">
					<td width="100%"><table class="QuickHd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" width="34"><a name="xx929565xx"></a><img src="evtvwr.aspx_files/msg_general.gif" alt="General" width="16" align="top" height="16"></td><td class="Frm_MsgSubject"><a id="DynMessLink" name="929565" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;noise=3&amp;sort=Position&amp;view=Quick&amp;select=929565#xx929565xx">Re: How to customize the event viewer?</a></td><td style="width: 20px; white-space: nowrap;"><img src="evtvwr.aspx_files/usersuss.gif" alt="suss" width="14" height="15"></td><td class="Frm_MsgAuthor">Alin I</td><td class="Frm_MsgDate" style="vertical-align: top; white-space: nowrap;">23:18 20 Sep '04 &nbsp;</td>
						</tr>
					</tbody></table></td>
				</tr><!-- End Message head -->

				<tr id="F929565_h1" style="display: none;">
					<td width="100%"><table class="QuickBd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" style="width: 34px;"><img src="evtvwr.aspx_files/t_002.gif" alt="" width="34" height="1"></td><td class="MsgBd BdSel"><table width="100%" border="0" cellpadding="0" cellspacing="5">
								<tbody><tr>
									<td><table width="100%" border="0" cellpadding="0" cellspacing="0">
										<tbody><tr>
											<td colspan="2">It's simple <img src="evtvwr.aspx_files/smiley_smile.gif" alt="Smile" align="top"><br><br>1. Run mmc.exe<br>2. In the mmc select File\Add Remove Snap-in. That will open the "Add Remove Snap-in" dialog. Add the Event Viewer snap-in.<br>3.
Close the dialog and you'll have the event viewer snap-in open. Right
click your custom log node and select "New window from here". It will
open another window with just your custom log node. Now you can close
the old snap-in window.<br>4. Optional. Select File\Options and in the
Options dialog you can set a name for your mmc file and change the file
icon. You can also change the Console Mode to "User mode - limited
access, single window".<br>5. Save your console to a msc file. <br> <br></td>
										</tr><tr style="vertical-align: middle;">
											<td class="Frm_MsgFt"><a class="Frm_MHL" href="http://www.codeproject.com/script/Membership/LogOn.aspx?rp=%2fKB%2fdotnet%2fevtvwr.aspx">Sign In</a>·<a class="Frm_MHL" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;sort=Position&amp;tid=865646" title="View Thread">View Thread</a>·<a class="Frm_MHL" href="http://www.codeproject.com/script/Forums/View.aspx?fid=15511&amp;msg=929565" title="Get permanent link">PermaLink</a></td><td class="Frm_MsgFt" style="text-align: right;"><span id="MVF929565" style="white-space: nowrap;"></span></td>
										</tr>
									</tbody></table></td>
								</tr>
							</tbody></table></td>
						</tr>
					</tbody></table></td>
				</tr><tr class="Quick">
					<td class="Frm_MsgRtDivide"><img src="evtvwr.aspx_files/t_002.gif" alt="" width="1" border="0" height="1"></td>
				</tr>
<!-- Start Message head -->

				<tr class="MsgHd Rt HdUnSel" id="F838210_h0">
					<td width="100%"><table class="QuickHd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" width="16"><a name="xx838210xx"></a><img src="evtvwr.aspx_files/msg_general.gif" alt="General" width="16" align="top" height="16"></td><td class="Frm_MsgSubject"><a id="DynMessLink" name="838210" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;noise=3&amp;sort=Position&amp;view=Quick&amp;select=838210#xx838210xx">TypesSupported confusion</a></td><td style="width: 20px; white-space: nowrap;"><img src="evtvwr.aspx_files/member_sm.gif" title="member" alt="member" border="0" height="16"></td><td class="Frm_MsgAuthor"><a href="http://www.codeproject.com/script/Membership/Profiles.aspx?mid=34782">Alois Kraus</a></td><td class="Frm_MsgDate" style="vertical-align: top; white-space: nowrap;">2:56 1 Jun '04 &nbsp;</td>
						</tr>
					</tbody></table></td>
				</tr><!-- End Message head -->

				<tr id="F838210_h1" style="display: none;">
					<td width="100%"><table class="QuickBd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" style="width: 16px;"><img src="evtvwr.aspx_files/t_002.gif" alt="" width="16" height="1"></td><td class="MsgBd BdSel"><table width="100%" border="0" cellpadding="0" cellspacing="5">
								<tbody><tr>
									<td><table width="100%" border="0" cellpadding="0" cellspacing="0">
										<tbody><tr>
											<td colspan="2">I am confused how many message types (severities) one dll can support. <br>The .h generated by mc.exe for a mc file claims:<br><br><code>//<br>//   3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1<br>//   1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0<br>//  +---+-+-+-----------------------+-------------------------------+<br>//  |Sev|C|R|     Facility          |               Code            |<br>//  +---+-+-+-----------------------+-------------------------------+<br>//<br>//  where<br>//<br>//      Sev - is the severity code<br>//<br>//          00 - Success<br>//          01 - Informational<br>//          10 - Warning<br>//          11 - Error<br></code><br><br>There are 2 Bits for severity reserved therefore I can have 4 message types.<br>But if I look into MSDN for the registry key TypesSupported:<br><br>Bitmask value Meaning <br>0 Success <br>1 Error <br>10 binary (2) Warning <br>100 binary (4) Information <br>1000 binary (8) Success audit <br>10000 binary (16) Failure audit <br><br>This value holds 6 Bits!<br><br>I do not see a way how 6 types can be mapped into 2 bits.<br>The .mc input files have to enumerate the supported severities from zero.<br>e.g <br>SeverityNames=(Success=0x0:STATUS_SEVERITY_SUCCESS<br>               Informational=0x1:STATUS_SEVERITY_INFORMATIONAL<br>               Warning=0x2:STATUS_SEVERITY_WARNING<br>               Error=0x3:STATUS_SEVERITY_ERROR<br>              )<br><br>This definition looks like an arbitrary number of types can be supported.<br>I do not know how this enumeration values are mapped to whatever bitfield<br>in the resource dll. <br><br>This looks very inconsistent to me.<br><br><br> <br></td>
										</tr><tr style="vertical-align: middle;">
											<td class="Frm_MsgFt"><a class="Frm_MHL" href="http://www.codeproject.com/script/Membership/LogOn.aspx?rp=%2fKB%2fdotnet%2fevtvwr.aspx">Sign In</a>·<a class="Frm_MHL" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;sort=Position&amp;tid=838210" title="View Thread">View Thread</a>·<a class="Frm_MHL" href="http://www.codeproject.com/script/Forums/View.aspx?fid=15511&amp;msg=838210" title="Get permanent link">PermaLink</a></td><td class="Frm_MsgFt" style="text-align: right;"><span id="MVF838210" style="white-space: nowrap;"></span></td>
										</tr>
									</tbody></table></td>
								</tr>
							</tbody></table></td>
						</tr>
					</tbody></table></td>
				</tr><tr class="Quick">
					<td class="Frm_MsgDivide"><img src="evtvwr.aspx_files/t_002.gif" alt="" width="1" border="0" height="1"></td>
				</tr>
<!-- Start Message head -->

				<tr class="MsgHd HdUnSel" id="F875268_h0">
					<td width="100%"><table class="QuickHd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" width="34"><a name="xx875268xx"></a><img src="evtvwr.aspx_files/msg_general.gif" alt="General" width="16" align="top" height="16"></td><td class="Frm_MsgSubject"><a id="DynMessLink" name="875268" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;noise=3&amp;sort=Position&amp;view=Quick&amp;select=875268#xx875268xx">Re: TypesSupported confusion</a></td><td style="width: 20px; white-space: nowrap;"><img src="evtvwr.aspx_files/member_sm.gif" title="member" alt="member" border="0" height="16"></td><td class="Frm_MsgAuthor"><a href="http://www.codeproject.com/script/Membership/Profiles.aspx?mid=34782">Alois Kraus</a></td><td class="Frm_MsgDate" style="vertical-align: top; white-space: nowrap;">3:27 14 Jul '04 &nbsp;</td>
						</tr>
					</tbody></table></td>
				</tr><!-- End Message head -->

				<tr id="F875268_h1" style="display: none;">
					<td width="100%"><table class="QuickBd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" style="width: 34px;"><img src="evtvwr.aspx_files/t_002.gif" alt="" width="34" height="1"></td><td class="MsgBd BdSel"><table width="100%" border="0" cellpadding="0" cellspacing="5">
								<tbody><tr>
									<td><table width="100%" border="0" cellpadding="0" cellspacing="0">
										<tbody><tr>
											<td colspan="2">I found that in the ReportEvent API function the second parameter<br>specified the event type. The eventid can be independently supplied.<br>This means that the logged event does not nescessarily needs to have<br>the severity specified in the .MC file.<br> <br></td>
										</tr><tr style="vertical-align: middle;">
											<td class="Frm_MsgFt"><a class="Frm_MHL" href="http://www.codeproject.com/script/Membership/LogOn.aspx?rp=%2fKB%2fdotnet%2fevtvwr.aspx">Sign In</a>·<a class="Frm_MHL" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;sort=Position&amp;tid=838210" title="View Thread">View Thread</a>·<a class="Frm_MHL" href="http://www.codeproject.com/script/Forums/View.aspx?fid=15511&amp;msg=875268" title="Get permanent link">PermaLink</a></td><td class="Frm_MsgFt" style="text-align: right;"><span id="MVF875268" style="white-space: nowrap;"></span></td>
										</tr>
									</tbody></table></td>
								</tr>
							</tbody></table></td>
						</tr>
					</tbody></table></td>
				</tr><tr class="Quick">
					<td class="Frm_MsgRtDivide"><img src="evtvwr.aspx_files/t_002.gif" alt="" width="1" border="0" height="1"></td>
				</tr>
<!-- Start Message head -->

				<tr class="MsgHd Rt HdUnSel" id="F828330_h0">
					<td width="100%"><table class="QuickHd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" width="16"><a name="xx828330xx"></a><img src="evtvwr.aspx_files/msg_general.gif" alt="General" width="16" align="top" height="16"></td><td class="Frm_MsgSubject"><a id="DynMessLink" name="828330" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;noise=3&amp;sort=Position&amp;view=Quick&amp;select=828330#xx828330xx">Link provide in article not working</a></td><td style="width: 20px; white-space: nowrap;"><img src="evtvwr.aspx_files/usersuss.gif" alt="suss" width="14" height="15"></td><td class="Frm_MsgAuthor">Anonymous</td><td class="Frm_MsgDate" style="vertical-align: top; white-space: nowrap;">8:20 20 May '04 &nbsp;</td>
						</tr>
					</tbody></table></td>
				</tr><!-- End Message head -->

				<tr id="F828330_h1" style="display: none;">
					<td width="100%"><table class="QuickBd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" style="width: 16px;"><img src="evtvwr.aspx_files/t_002.gif" alt="" width="16" height="1"></td><td class="MsgBd BdSel"><table width="100%" border="0" cellpadding="0" cellspacing="5">
								<tbody><tr>
									<td><table width="100%" border="0" cellpadding="0" cellspacing="0">
										<tbody><tr>
											<td colspan="2">Excellent work. <br>Can you please take a look at the link you provided in article.<br>http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tools/mc_77lf.asp.<br><br>Doesn't seem to work for me. <br></td>
										</tr><tr style="vertical-align: middle;">
											<td class="Frm_MsgFt"><a class="Frm_MHL" href="http://www.codeproject.com/script/Membership/LogOn.aspx?rp=%2fKB%2fdotnet%2fevtvwr.aspx">Sign In</a>·<a class="Frm_MHL" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;sort=Position&amp;tid=828330" title="View Thread">View Thread</a>·<a class="Frm_MHL" href="http://www.codeproject.com/script/Forums/View.aspx?fid=15511&amp;msg=828330" title="Get permanent link">PermaLink</a></td><td class="Frm_MsgFt" style="text-align: right;"><span id="MVF828330" style="white-space: nowrap;"></span></td>
										</tr>
									</tbody></table></td>
								</tr>
							</tbody></table></td>
						</tr>
					</tbody></table></td>
				</tr><tr class="Quick">
					<td class="Frm_MsgDivide"><img src="evtvwr.aspx_files/t_002.gif" alt="" width="1" border="0" height="1"></td>
				</tr>
<!-- Start Message head -->

				<tr class="MsgHd HdUnSel" id="F865500_h0">
					<td width="100%"><table class="QuickHd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" width="34"><a name="xx865500xx"></a><img src="evtvwr.aspx_files/msg_general.gif" alt="General" width="16" align="top" height="16"></td><td class="Frm_MsgSubject"><a id="DynMessLink" name="865500" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;noise=3&amp;sort=Position&amp;view=Quick&amp;select=865500#xx865500xx">Re: Link provide in article not working</a></td><td style="width: 20px; white-space: nowrap;"><img src="evtvwr.aspx_files/member_sm.gif" title="member" alt="member" border="0" height="16"></td><td class="Frm_MsgAuthor"><a href="http://www.codeproject.com/script/Membership/Profiles.aspx?mid=126694">Matt Casto</a></td><td class="Frm_MsgDate" style="vertical-align: top; white-space: nowrap;">7:54 1 Jul '04 &nbsp;</td>
						</tr>
					</tbody></table></td>
				</tr><!-- End Message head -->

				<tr id="F865500_h1" style="display: none;">
					<td width="100%"><table class="QuickBd" width="100%" border="0" cellpadding="0" cellspacing="0">
						<tbody><tr>
							<td class="Frm_MsgIndent" style="width: 34px;"><img src="evtvwr.aspx_files/t_002.gif" alt="" width="34" height="1"></td><td class="MsgBd BdSel"><table width="100%" border="0" cellpadding="0" cellspacing="5">
								<tbody><tr>
									<td><table width="100%" border="0" cellpadding="0" cellspacing="0">
										<tbody><tr>
											<td colspan="2">I think the following link is the correct URL.<br><br><a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tools/tools/message_text_files.asp">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tools/tools/message_text_files.asp</a>[<a target="_blank" title="New Window" href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tools/tools/message_text_files.asp">^</a>] <br></td>
										</tr><tr style="vertical-align: middle;">
											<td class="Frm_MsgFt"><a class="Frm_MHL" href="http://www.codeproject.com/script/Membership/LogOn.aspx?rp=%2fKB%2fdotnet%2fevtvwr.aspx">Sign In</a>·<a class="Frm_MHL" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;sort=Position&amp;tid=828330" title="View Thread">View Thread</a>·<a class="Frm_MHL" href="http://www.codeproject.com/script/Forums/View.aspx?fid=15511&amp;msg=865500" title="Get permanent link">PermaLink</a></td><td class="Frm_MsgFt" style="text-align: right;"><span id="MVF865500" style="white-space: nowrap;"></span></td>
										</tr>
									</tbody></table></td>
								</tr>
							</tbody></table></td>
						</tr>
					</tbody></table></td>
				</tr><tr>
					<td><img src="evtvwr.aspx_files/t_002.gif" alt="" width="1" border="0" height="5"></td>
				</tr>
			</tbody></table></td>
		</tr><tr>
			<td><table width="100%" cellpadding="2" cellspacing="0">
				<tbody><tr class="Frm_Footer">
					<td>Last Visit: 10:25 6 Mar '09  &nbsp; &nbsp; Last Update: 10:25 6 Mar '09 </td><td style="text-align: right; white-space: nowrap;"><b>1</b> <a class="Frm_HL" name="Frm_HoverNL" href="http://www.codeproject.com/KB/dotnet/evtvwr.aspx?fid=15511&amp;df=90&amp;mpp=25&amp;noise=3&amp;sort=Position&amp;view=Quick&amp;fr=26#xx0xx">Next »</a></td>
				</tr>
			</tbody></table></td>
		</tr>
	</tbody></table>
</div><p class="SmallText"><img src="evtvwr.aspx_files/msg_general.gif" alt="General" width="16" align="top" height="16"> General &nbsp;&nbsp; <img src="evtvwr.aspx_files/msg_news.gif" alt="News" width="16" align="top" height="16"> News &nbsp;&nbsp; <img src="evtvwr.aspx_files/msg_question.gif" alt="Question" width="16" align="top" height="16"> Question &nbsp;&nbsp; <img src="evtvwr.aspx_files/msg_answer.gif" alt="Answer" width="16" align="top" height="16"> Answer &nbsp;&nbsp; <img src="evtvwr.aspx_files/msg_joke.gif" alt="Joke" width="16" align="top" height="16"> Joke &nbsp;&nbsp; <img src="evtvwr.aspx_files/msg_rant.gif" alt="Rant" width="16" align="top" height="16"> Rant &nbsp;&nbsp; <img src="evtvwr.aspx_files/msg_admin.gif" alt="Admin" width="16" align="top" height="16"> Admin &nbsp;&nbsp; </p>
<!-- Forum End -->




	
	</div>
	
	<table width="100%">
	<tbody><tr valign="top">
		<td class="TinyText" align="left">
		    <a id="ctl00_PermaLink" href="http://www.codeproject.com/script/Articles/Article.aspx?aid=4153">PermaLink</a> | 
			<a id="ctl00_PrivacyLink" href="http://www.codeproject.com/info/privacy.aspx">Privacy</a> |
			<a id="ctl00_TermsOfUseLink" href="http://www.codeproject.com/info/TermsOfUse.aspx">Terms of Use</a>
			<br>Last Updated: 17 May 2003<br>
			Editor: <a id="ctl00_ArticleEditor" href="http://www.codeproject.com/script/Membership/Profiles.aspx?mid=28970">Smitha Vijayan</a><br>
		</td>
		<td class="TinyText" valign="top" align="right">
			Copyright 2003 by Manoj G<br>Everything else
			Copyright © <a href="mailto:webmaster@codeproject.com">CodeProject</a>, 1999-2009 <br>
			Web13 |
			<a id="ctl00_AdvertiseLink" href="http://www.codeproject.com/info/MediaKit.aspx">Advertise on the Code Project </a>
		</td>
	</tr>
	
	</tbody></table>
	
	<center>
		
	</center>

</div>
</div>	
	
<div>


</div>

<br>
<script type="text/javascript" language="Javascript">//<![CDATA[
if (document.all) try {window.attachEvent("oncopy",copyCode);}catch(e){};
//]]></script>

<script type="text/javascript" language="Javascript" src="evtvwr.aspx_files/TogglePre.js"></script>
<script type="text/javascript" language="Javascript">//<![CDATA[
$(document).ready(function() {RetrieveJobsSummary('Th',4153,2,43,"83,10,23,175,179,184,37,118,153");});
//]]></script>


</body></html>