473,850 Members | 2,082 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using Enterprise Library to write in a custom event log

Hello,

I've started using Enterprise Library 2.0 recently and I've encountered
a problem that seems to be ... well... undocumented :)

Basically, when I set a Trace Listener (formatted event log to be
precise), if i specify the name of a custom event log, the listener
won't log in it.

I've checked in the registry, the log is there. In the event viewer, I
can see the log but enterprise library wont use it. Actually, I've
noticed that if I overwrite "Applicatio n" with anything else it doesnt
work either. (like System or Security)

If I write in the log manually (in the code) it works just fine. But
the point of the whole thing is to use the MS Application Blocks so im
trying not to log the error myself.

Is there some kind of access right I have to set somewhere ?

Am I doing something wrong ?

Thanks....

*************** ******

Here's the code I can show you :

I've made a chunk of code to create the event log like so. Right now
its executed everytime the website is started since I'm still in dev.

Private Const cLMI_EVENT_SOUR CE As String = "LMIV40"
....
If Not EventLog.Source Exists(cLMI_EVE NT_SOURCE) Then
EventLog.Create EventSource(cLM I_EVENT_SOURCE, cLMI_EVENT_SOUR CE)
End If

Then, I've configured the weg.config like so (i've used the
entlibconfig tool)

<loggingConfigu ration name="Logging Application Block"
tracingEnabled= "true"
defaultCategory ="General" logWarningsWhen NoCategoriesMat ch="true">
<listeners>
<add source="Enterpr ise Library Logging" formatter="Text
Formatter"
log="LMIV40" machineName=""
listenerDataTyp e="Microsoft.Pr actices.Enterpr iseLibrary.Logg ing.Configurati on.FormattedEve ntLogTraceListe nerData,
Microsoft.Pract ices.Enterprise Library.Logging , Version=2.0.0.0 ,
Culture=neutral , PublicKeyToken= null"
traceOutputOpti ons="Callstack"
type="Microsoft .Practices.Ente rpriseLibrary.L ogging.TraceLis teners.Formatte dEventLogTraceL istener,
Microsoft.Pract ices.Enterprise Library.Logging , Version=2.0.0.0 ,
Culture=neutral , PublicKeyToken= null"
name="LMIV4.0 Tracer" />
</listeners>
<formatters>
<add template="Times tamp: {timestamp}&#xD ;&#xA;Message :
{message}&#xD;& #xA;Category: {category}&#xD; &#xA;Priorit y:
{priority}&#xD; &#xA;EventId : {eventid}&#xD;& #xA;Severity:
{severity}&#xD; &#xA;Title:{tit le}&#xD;&#xA;Ma chine:
{machine}&#xD;& #xA;Application Domain: {appDomain}&#xD ;&#xA;Process Id:
{processId}&#xD ;&#xA;Process Name: {processName}&# xD;&#xA;Win32 Thread
Id: {win32ThreadId} &#xD;&#xA;Threa d Name:
{threadName}&#x D;&#xA;Extende d Properties: {dictionary({ke y} -
{value}&#xD;&#x A;)}"

type="Microsoft .Practices.Ente rpriseLibrary.L ogging.Formatte rs.TextFormatte r,
Microsoft.Pract ices.Enterprise Library.Logging , Version=2.0.0.0 ,
Culture=neutral , PublicKeyToken= null"
name="Text Formatter" />
</formatters>
<categorySource s>
<add switchValue="Al l" name="General">
<listeners>
<add name="LMIV4.0 Tracer" />
</listeners>
</add>
</categorySources >
<specialSources >
<allEvents switchValue="Al l" name="All Events">
<listeners>
<add name="LMIV4.0 Tracer" />
</listeners>
</allEvents>
<notProcessed switchValue="Al l" name="Unprocess ed Category" />
<errors switchValue="Al l" name="Logging Errors &amp; Warnings" />
</specialSources>
</loggingConfigur ation>

Jun 15 '06 #1
0 5017

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

Similar topics

4
3803
by: The_Incubator | last post by:
As the subject suggests, I am interested in using Python as a scripting language for a game that is primarily implemented in C++, and I am also interested in using generators in those scripts... Initially I was justing looking at using Python for some event scripting. So basically an event would trigger an object to run the appropriate Python script, which would be run in it's entirety and return control to the C++ code. After looking...
6
1957
by: Jonathan Crawford | last post by:
Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable) +473 Hi I have installed the enterprise library on a development machine and created a project on our webserver. When I run a simple data access page I get an error message. Apparently
0
1327
by: John Dalberg | last post by:
I am getting the error below many times when I am trying to use the Enterprise Library. The solution seems to be a reboot. I am using Windows 2003 as my dev box. The error also happens with other library blocks. I am in the admin group in the machine and I changed the processmodel in machine.config to SYSTEM. AFAIK, I have elevated my access to the highest.
1
4148
by: David Herbst | last post by:
Enterprise Library Jan 2006 with Visual Studio 2005 on Windows 2000 Server sp4. My custom exception formatter fails with a "Unable to handle exception: 'LoggingExceptionHandler'." exception. When I attached the debugger to the process and stepped into the code it executed without error. In both cases I was running a Debug build, the only difference in the case that works is that I attached the debugger to the same exact binaries....
3
2071
by: Udi | last post by:
Hi All, I'm developping an application that has a very strong logging requirement - we should be able to log up to 5000 messages per second, most of them are reletively small -(16 - 30 Words) while few of them might get to 1Kb in size. The data is binary (numbers) that should be converted to text of course. I'm affraid of a "logging-bottleneck" in my app.
1
1145
by: Jerry | last post by:
I am creating an ASP.NET page that does the following: The Page_Load event connects to the database to populate a dropdown list. The Button_Click event connects to the database to check if the record ID already exists and if it doens't, it gets the highest ID. Another connection inserts the new records to the database. The Button_Click even uses the same SqlConnection and two different
1
1342
by: Arne Garvander | last post by:
Is this a good place for asking question re Enterprise Library for .Net Framework 1.1? How can I get the Exception block to send an email for each exception? Is that built in? -- Arne Garvander (I program VB.Net for fun and C# to get paid.)
0
1658
by: =?Utf-8?B?U2hyaWthbnQgTW9yZQ==?= | last post by:
Using enterprise library's 3.1 Logging Application Block , how can i get the custom source name in the windows event log.When ever i am logging an error in windows event log , it gives the source name as Enterprise Library Logging.I want my custom source name instead of Enterprise Library Logging.Also how can i get the username and category also, through Logging Application Block.
1
1323
by: pankajprakash | last post by:
Hi, I have used Application Loggin Enterprise Library in a web application to write the event information in a file. The file is exist in the other location, and the web application does have have any writes to write in the file. Would you please let me know how I can pass the credential with the Application Logging Enterprise Library.
0
9744
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11011
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10670
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10725
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9503
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5931
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4547
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4142
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3178
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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

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