472,958 Members | 1,773 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 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 4905

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
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.