473,287 Members | 3,240 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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 "Application" 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_SOURCE As String = "LMIV40"
....
If Not EventLog.SourceExists(cLMI_EVENT_SOURCE) Then
EventLog.CreateEventSource(cLMI_EVENT_SOURCE, cLMI_EVENT_SOURCE)
End If

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

<loggingConfiguration name="Logging Application Block"
tracingEnabled="true"
defaultCategory="General" logWarningsWhenNoCategoriesMatch="true">
<listeners>
<add source="Enterprise Library Logging" formatter="Text
Formatter"
log="LMIV40" machineName=""
listenerDataType="Microsoft.Practices.EnterpriseLi brary.Logging.Configuration.FormattedEventLogTrace ListenerData,
Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=null"
traceOutputOptions="Callstack"
type="Microsoft.Practices.EnterpriseLibrary.Loggin g.TraceListeners.FormattedEventLogTraceListener,
Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=null"
name="LMIV4.0 Tracer" />
</listeners>
<formatters>
<add template="Timestamp: {timestamp}&#xD;&#xA;Message:
{message}&#xD;&#xA;Category: {category}&#xD;&#xA;Priority:
{priority}&#xD;&#xA;EventId: {eventid}&#xD;&#xA;Severity:
{severity}&#xD;&#xA;Title:{title}&#xD;&#xA;Machine :
{machine}&#xD;&#xA;Application Domain: {appDomain}&#xD;&#xA;Process Id:
{processId}&#xD;&#xA;Process Name: {processName}&#xD;&#xA;Win32 Thread
Id: {win32ThreadId}&#xD;&#xA;Thread Name:
{threadName}&#xD;&#xA;Extended Properties: {dictionary({key} -
{value}&#xD;&#xA;)}"

type="Microsoft.Practices.EnterpriseLibrary.Loggin g.Formatters.TextFormatter,
Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=null"
name="Text Formatter" />
</formatters>
<categorySources>
<add switchValue="All" name="General">
<listeners>
<add name="LMIV4.0 Tracer" />
</listeners>
</add>
</categorySources>
<specialSources>
<allEvents switchValue="All" name="All Events">
<listeners>
<add name="LMIV4.0 Tracer" />
</listeners>
</allEvents>
<notProcessed switchValue="All" name="Unprocessed Category" />
<errors switchValue="All" name="Logging Errors &amp; Warnings" />
</specialSources>
</loggingConfiguration>

Jun 15 '06 #1
0 4954

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

Similar topics

4
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... ...
6
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...
0
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...
1
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. ...
3
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)...
1
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...
1
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...
0
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...
1
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...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.