473,320 Members | 2,027 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,320 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 4958

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...
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: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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...
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)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.