Email TraceListener not working

Topics: Logging Application Block
Jul 7, 2009 at 10:19 PM

I have  an Email TraceListener attached to a Category attached to a Logging Handler.  I also have a FlatFile TraceListener attached to the same Category as the Email TraceListener.  This are all connected to an Exception Handler.  The FlatFile TraceListener is working fine.  The Email one is not.

Here's the setup:

<listeners>

 

<font size="3" color="#0000ff"><font size="3" color="#0000ff">

<

</font></font><font size="3" color="#0000ff">

 

</font>

add toAddress="valid@emailaddress.com" fromAddress="valid@emailaddress.com"

 

<font size="3" color="#0000ff"><font size="3" color="#0000ff">

 

</font></font><font size="3" color="#0000ff">

 

</font>

subjectLineStarter="EntLibTest:" subjectLineEnder="" smtpServer="subdom1.ouremailserver.com" <font size="3" color="#0000ff"><font size="3" color="#0000ff">

 

</font></font><font size="3" color="#0000ff">

 

</font>

smtpPort="25" formatter="Text Formatter" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.EmailTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=...removed..." <font size="3" color="#0000ff"><font size="3" color="#0000ff">

 

</font></font><font size="3" color="#0000ff">

 

</font>

traceOutputOptions="None" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.EmailTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=...removed..." <font size="3" color="#0000ff"><font size="3" color="#0000ff">

 

</font></font><font size="3" color="#0000ff">

 

</font>

name="Email TraceListener" />

I think my SmtpServer name is not formatted correctly but I'm not sure.  What should the smtpServer setting look like? And could it be something else.  The email addresses and the smtpServer settings have been changed but they are in the same format as the original.

 

Ideas?

 

Thanks!!!

Jul 8, 2009 at 7:22 AM

Hi,

You can try using the IP address of the SMTP server for the SmtpServer property.

Valiant Dudan
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

Jul 8, 2009 at 3:06 PM

Unfortunately I don't have that option.  I work for a very large organization and IP addresses are not given out for the mail servers.

What other things might I try?

Jul 8, 2009 at 3:17 PM

Does your smtp server requires authentication?  coz the out-of-the-box emailtracelistener doesn't support it.  There's a version of the emailtracelistener which supports this  in the EntLib Contrib project.

 

Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

Jul 8, 2009 at 5:30 PM

It doesn't require authentification but I just found out that it will only accept email from certain pre-registered IP addresses.    So, I have redirected my email back to the email server that is pending decommission for the time being.

Sorry, this was kind of a wild goose chance.

Thanks for your help!!

Jul 22, 2009 at 6:48 AM

Hi,

My smtp server requires authentication.Can any one tell how to set this?

Am using Entrprise Library Logging 4.1 : Email Trace Listener for Logging through Emails.

 

Thanks,

Madhu.

Jul 22, 2009 at 8:14 AM

As sarah said, the emailtrace listener that comes with ent lib doesn't support authentication, one thing you can do is to modify the email trace listener to support adding of the authentication for the smtpserver. Also you can check this link http://www.codeplex.com/AuthEmailTraceListen  for the sample implemetation.

Valiant Dudan
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

Jul 22, 2009 at 9:04 AM

Thanks Valiant for the replay..

As per the above link(http://www.codeplex.com/AuthEmailTraceListen) ,

1.Sprydon.AuthenticatingEmailTraceListener

2.Sprydon.AuthenticatingEmailTraceListener.Configuration.Design

assemblies  should be copied to entlb bin folder.

Can u tell me from where i can get these dlls?



Jul 22, 2009 at 9:49 AM

You can find the assemblies here http://authemailtracelisten.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=1889 , there are 2 options for download, which are the source and the binaries, I think copying the binaries to the Ent lib 4.1 bin folder wont work. Since that binaries was meant for Ent lib 2.0. You will exert extra effort in converting it, in order to be used against the ent lib 4.1. So, what you can do it download the source, update the references to the ent lib 4.1 assemblies. Build the project and copy to the bin folder. I already tried converting it and on my side I dont encounter any problem and I've used it against 4.1. Please try.

Valiant Dudan
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

Jul 22, 2009 at 10:27 AM

Can u tell me what do u mean by Updating references to the ent lib 4.1 assemblies and how it has to be done?

Do we need to modify any code in that source code?

if yes please let me know..

Jul 22, 2009 at 10:42 AM

When you open the source code, the projects there has an assembly reference specific to ent lib 2.0, since you are using ent lib 4.1, there might be a need to replace those assemblies to point to the ent lib 4.1 assemblies. One thing I remember, I modified something from the source code, in the using Statement, because the source uses the ObjectBuilder but ent lib 4.1 uses the ObjectBuilder2 so that might need to be updated. I have the solution that is already modified, If you want, I can send you that.

Valiant Dudan
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

Jul 22, 2009 at 11:02 AM

Yes,please send me that code....

Jul 22, 2009 at 11:19 AM

where should i send it?

Jul 22, 2009 at 11:37 AM
Edited Jul 22, 2009 at 12:50 PM

Pls. Send to this:

madhu.valusa@gmail.com

Jul 22, 2009 at 2:28 PM
Edited Jul 22, 2009 at 3:51 PM

Thanks...I got the code..

I have placed that dlls in bin .

I have added the Authenticating Email Trace Listener .

1.But am getting the following error,if am going to use that web service in the application

System.ServiceModel.FaultException: The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs. Server stack trace: at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter) at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at WebApp_email_log.ServiceRef_email_log.IService1.GetData(Int32 value) at WebApp_email_log.ServiceRef_email_log.Service1Client.GetData(Int32 value) in d:\projects\webapp_email_log\webapp_email_log\service references\serviceref_email_log\reference.cs:line 116 at WebApp_email_log._Default.Page_Load(Object sender, EventArgs e) in D:\Projects\WebApp_email_log\WebApp_email_log\Default.aspx.cs:line 24

 

2.Even though i am providing value for formatter as "Text Formatter", it is resetting back to "none" when i reopen web.config with the tool next time.

 


Jul 22, 2009 at 4:04 PM

For the

1. I have placed

<serviceDebug includeExceptionDetailInFaults="true" />

After this am getting the following error:

Invalid TraceListenerData type in configuration 'listenerDataType="Sprydon.TraceListeners.Configuration.AuthenticatingEmailTraceListenerData, Sprydon.AuthenticatingEmailTraceListener, Version=1.0.0.31180, Culture=neutral, PublicKeyToken=null"

2. can i put manually in config file as "TextFormatter"?

If we r going to do so, we are getting "TextFormatter" if we r going to reopen..

 

Please tell me how to resolve this?

Jul 23, 2009 at 6:05 AM

You probably didn't referenced the AuthenticatingEmailTraceListenerData assembly in your project that's why you are encountering the error.  On item number 2, it's a bug so yes, you can just go ahead and put in the name you specified for the Text Formatter. 

 

Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

Jul 23, 2009 at 6:31 AM

I have referred the assemblies in the web service.

Now am not getting that error.

But not getting Emails even after  the successful build also...

 

Jul 23, 2009 at 7:04 AM

Check the event log for any information if there was an exception that occured (if you specified a FormattedEventLogTraceListener under the Logging Errors and Warnings node).

 

Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

Jul 23, 2009 at 8:55 AM

Hi sarah,

I have added the FormattedEventLogTraceListener for the same category, in which AuthenticatingEmailTraceListener was added.

Am getting the log messsage in the Even Log but not as mail.

Pls help me out in this ...

Jul 23, 2009 at 9:34 AM

Did you add the FormattedEventLogTraceListener to the Logging Errors and Warnings Section?  I'm asking this because we might be able to see if there was an exception that occured while logging using the authenticated emailtracelistener.  The Logging Application Block does not throw exception if the tracelisteners logging operation failed, it just automatically logs all errors which occured using the tracelisteners under the Logging Errors and Warnings node. 

 

Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

Jul 23, 2009 at 9:52 AM
Edited Jul 23, 2009 at 10:23 AM

I have added FormattedEventLogTraceListener to the Logging Errors and Warnings Section and am getting the following error in eventlog

Timestamp: 7/23/2009 8:43:55 AM
Message: Tracing to LogSource 'EmailCategory' failed. Processing for other sources will continue. See summary information below for more information. Should this problem persist, stop the service and check the configuration file(s) for possible error(s) in the configuration of the categories and sinks.


Summary for Enterprise Library Distributor Service:
======================================
-->
Message:
Timestamp: 7/23/2009 8:43:51 AM
Message: Input string was not in a correct format.
Category: EmailCategory
Priority: 1
EventId: 123
Severity: Information
Title:mscorlib
App Domain: 86a86a87-4-128928122107187500
ProcessId: 4104
Process Name: C:\Program Files\Common Files\Microsoft Shared\DevServer\9.0\WebDev.WebServer.exe
Thread Name:
Win32 ThreadId:4864
Extended Properties:
--> TimeStamp: 7/23/2009 8:43:55 AM
--> FullName: Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
--> AppDomainName: 86a86a87-4-128928122107187500
--> WindowsIdentity: --\Madhu

Exception Information Details:
======================================
Exception Type: System.Net.Mail.SmtpFailedRecipientException
FailedRecipient: <valid@email.com>
StatusCode: MailboxUnavailable
Message: Mailbox unavailable. The server response was: must be authenticated
Data: System.Collections.ListDictionaryInternal
TargetSite: System.Net.Mail.MailWriter SendMail(System.Net.Mail.MailAddress, System.Net.Mail.MailAddressCollection, System.String, System.Net.Mail.SmtpFailedRecipientException ByRef)
HelpLink: NULL
Source: System

StackTrace Information Details:
======================================
   at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception)
   at System.Net.Mail.SmtpClient.Send(MailMessage message)
   at Sprydon.TraceListeners.Configuration.EmailMessage.SendMessage(MailMessage message)
   at Sprydon.TraceListeners.Configuration.EmailMessage.Send()
   at Sprydon.TraceListeners.AuthenticatingEmailTraceListener.TraceData(TraceEventCache eventCache, String source, TraceEventType eventType, Int32 id, Object data)
   at Microsoft.Practices.EnterpriseLibrary.Logging.LogSource.TraceData(TraceEventType eventType, Int32 id, LogEntry logEntry, TraceListenerFilter traceListenerFilter)
   at Microsoft.Practices.EnterpriseLibrary.Logging.LogWriter.ProcessLog(LogEntry log)

Jul 23, 2009 at 10:15 AM

Well, basic questions: 

Did you set the SmtpUserName and SmtpPassword?

Did you set Authenticate property to true? 

If you did, add logging statements inside the source code of the AuthenticatedEmailTraceListener source code.  Log those information which are critical such as the username and password.  I can't try it out for myself as I don't have the necessary resources to test this. 

 

Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

Jul 23, 2009 at 10:28 AM

Sry to tell u that Authenticate property was not set to true.

Now its working fine...

Am getting mails....

Thanks a lot Sarah and Valiant..

 

Jul 23, 2009 at 11:59 AM

Its working fine ..

But while building the web service am getting some messages(more than 40)  like

Could not find schema information for the attribute 'loggingconfiguration'

Could not find schema information for the attribute 'name'

......

can u tell why am getting these messages?

Jul 23, 2009 at 12:23 PM

Refer to this thread  - http://entlib.codeplex.com/Thread/View.aspx?ThreadId=10712.

 

Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

Jul 24, 2009 at 11:52 AM
Edited Jul 24, 2009 at 1:39 PM

Thanks sarah...

How set the Subject for the mail we are getting,using the entlib tool ?

Is there any way to set this?

 

 

Jul 27, 2009 at 3:24 AM
Edited Jul 27, 2009 at 3:24 AM

You would have to modify the source code as the current behavior of the email traceListeners (both the one provided by entlib and the authenticating tracelistener) is to build the subject by concatenating the subject line starter + logEntry.Severity + subject line ender.  

 

Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

Mar 31, 2010 at 10:38 AM

Hi Sarah,

 

Thanks Sarah, it really helped me to get an idea about authentication.

 

In this post, you have sent the source code with changes made for entlib 4.1 to madhu to build the autenticatiingEmailListener. Can you please send me that source code. If you have a source code Entlib 3.1, it will be more usefull.

 

Thanks in advance

Apr 5, 2010 at 8:01 AM

I don't have the source code, my other colleague created that.  I actually had an update on this, the out-of-the-box email trace listener of entlib can actually indirectly support authentication.  Please refer to this thread:  http://entlib.codeplex.com/Thread/View.aspx?ThreadId=57165

If you still need to a custom trace listener, the source code for the authenticating email trace listener is in here - http://authemailtracelisten.codeplex.com/releases/view/1889.  Let me know what are the specific requirements you have which prompts you to still modify this source code.

Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

May 11, 2010 at 8:50 PM
Edited May 11, 2010 at 8:51 PM
madhulatha wrote:

Yes,please send me that code....

 Please, can you send me the same code - suneela_chavali@jabil.com

May 12, 2010 at 1:48 AM

Sent.  But actually, you just need to update the references.  No real code change was made other than to modify the namespace of Microsoft.Practices.ObjectBuilder to Microsoft.Practices.ObjectBuilder2

 

Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

May 12, 2010 at 3:04 PM
Edited May 12, 2010 at 4:59 PM

Thanks Sarah!

I updated ObjectBuilder reference with ObjectBuilder2. Built the application and copied the 2 dll's to Microsoft Enterprise Library 4.1 - October 2008/bin.

Actually, my SMTP server do not need authentication, because I am able to send email using below code from Global.aspx

System.Web.Mail.SmtpMail.Send("suneela_chavali@jabil.com", "suneela_chavali@jabil.com", "Un expected error", objErr.Message);

I tried using Email Trace Listener; SmtpServer = localhost instead of 127.0.0.1 and it worked.

My question is, I am able to do that even without using Application Blocks, directly in my Global.asax, I can send email using " System.Web.Mail.SmtpMail.Send ()" and can also log the error in EventLog using EventLog.WriteEntry(). So, I am wondering what is the advantage of using Application Blocks for Exception Handling and Logging Errors? Sorry for asking you the basic question.

-Suneela.

May 13, 2010 at 2:10 AM
Edited May 13, 2010 at 2:14 AM

The application blocks included in enterprise library are easy to use and encapsulates best practices for .NET applications.  They provide consistent APIS for logging, handling exceptions, performing database calls, etc.  They're configuration-driven which means that you can control its behavior through configuration without modifying your code and requiring recompilation.  Yes you can write using the SmtpMail and EventLog apis but with the Logging Application Block, if you initially configured your application to log in the eventlog but later decided to send emails as well, then you can accomplish that without adding calls to SmtpMail.Send; you just modify your config by adding an Email Trace Listener.  The Logger.Write API can send to any trace listener you setup in your config. On the case of Exception Handling, if later decided on to change how a specific exception is handled, again, you can modify, add, or delete exception handlers in the config. 

 

Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

May 14, 2010 at 2:43 PM
Thanks Sarah! I liked the way you explained it and see the advantages of Microsoft Application Blocks.

I decided to use Application Blocks for my application Error Handling. Here are my questions:

1) I am able to log the exception to EventLog, FlatFile and Email. I wanted to do Database log as well, using Database Trace Listener. I use Oracle database. I searched a lot, but could not find an example illustrating how to do that. Please can me send me an example of that.

2) I wanted to log the exceptions in 2 two ways. If it is a SoapException, i want to send email. If it is any other exception, I want to log it to EventLog. So, how do I accomplish this?

-Suneela.


From: [email removed]
To: [email removed]
Date: Wed, 12 May 2010 18:10:49 -0700
Subject: Re: Email TraceListener not working [entlib:61770]

From: AvanadeSupport
The application blocks included in enterprise library are easy to use and encapsulates best practices for .NET applications. They're configuration-driven which means that you can control its behavior through configuration without modifying your code and requiring recompilation. Yes you can write using the SmtpMail and EventLog apis but with the Logging Application Block, if you initially configured your application to log in the eventlog but later decided to send emails as well, then you can accomplish that without adding calls to SmtpMail.Send; you just modify your config by adding an Email Trace Listener. On the case of Exception Handling, if later decided on to change how a specific exception is handled, again, you can modify, add, or delete exception handlers in the config.

Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com
Read the full discussion online.
To add a post to this discussion, reply to this email (entlib@discussions.codeplex.com)
To start a new discussion for this project, email entlib@discussions.codeplex.com
You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.
Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com


Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox. Learn more.
May 17, 2010 at 3:55 AM

Answering first your question #2, first, you need to configure the logging application block.  Add an email trace listener and configure the necessary properties.  Add a category and associate your email trace listener to that category.  Let's assume then that you name your category as "EmailEvents".  Add then a formatted event log trace listener and create a category, let's say "Events" and associate it to the event log trace listener.

Next, define an exception policy and add the exception of type SoapException.  Add then a Logging Handler for it and set the value of the LogCategory to EmailEvents. 

Add another exception of type, simply Exception.  Configure also a Logging Handler for it and set the value of the LogCategory to Events.

That's it, you can now use that exception policy to handle your exceptions.

 

On question #1, I always thought it's as straight forward as defining an oracle connection string and referencing it as the value of the DatabaseInstance property of a Database Trace Listener.  However, I haven't actually tried it since I have no Oracle database on my machine and I recently encounter this post - http://entlib.codeplex.com/Thread/View.aspx?ThreadId=209964.  Check it out first.

 

Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

May 17, 2010 at 7:56 PM
Hi Sarah,

Thanks for the reply!

Even before I started to try Database Listener, I encountered with another problem. My Exception and Logging blocks used to handle an exception using Flatfile, Email, EventLog Listeners. I dont know, what happened, now suddenly nothing is working. I tried all different ways i can think about. I tried, deleting all other listeners, and tried with one each. Still, nothing is working. Please find attached Global.asax, web.config and the server error that is displayed. Please help me with this. I am not findind any clue.

-Suneela.

From: [email removed]
To: [email removed]
Date: Sun, 16 May 2010 19:55:59 -0700
Subject: Re: Email TraceListener not working [entlib:61770]

From: AvanadeSupport
Answering first your question #2, first, you need to configure the logging application block. Add an email trace listener and configure the necessary properties. Add a category and associate your email trace listener to that category. Let's assume then that you name your category as "EmailEvents". Add then a formatted event log trace listener and create a category, let's say "Events" and associate it to the event log trace listener.
Next, define an exception policy and add the exception of type SoapException. Add then a Logging Handler for it and set the value of the LogCategory to EmailEvents.
Add another exception of type, simply Exception. Configure also a Logging Handler for it and set the value of the LogCategory to Events.
That's it, you can now use that exception policy to handle your exceptions.

On question #1, I always thought it's as straight forward as defining an oracle connection string and referencing it as the value of the DatabaseInstance property of a Database Trace Listener. However, I haven't actually tried it since I have no Oracle database on my machine and I recently encounter this post - http://entlib.codeplex.com/Thread/View.aspx?ThreadId=209964. Check it out first.

Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

Read the full discussion online.
To add a post to this discussion, reply to this email (entlib@discussions.codeplex.com)
To start a new discussion for this project, email entlib@discussions.codeplex.com
You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.
Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com


Hotmail is redefining busy with tools for the New Busy. Get more from your inbox. See how.
May 18, 2010 at 4:30 AM

I did not receive any email so I wasn't able to check your attachments.  What is your OS?  Does the app used to log before?  Configure a trace listener under the Logging Errors and Warnings so that if any logging fails, it will log information regarding why the logging failed.  Check also this entlib faq for other suggestions- http://entlib.codeplex.com/wikipage?title=Why%20are%20messages%20not%20logged%3f&referringTitle=EntLib%20FAQ.

 

  

Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

May 18, 2010 at 1:52 PM
Edited May 18, 2010 at 4:18 PM

Hi Sarah,

I realized the mistake i did. Instead of adding reference (Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.dll, etc) to my Project bin folder, I did "Add Existing Item" which resulted in Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.xml not being added to bin. That was the issue. So, i fixed it, it is worked as good as before.

1) Now, i am able to log exceptions in different ways, ex: log SoapException to Email and others to EventLog. I followed the process you mentioned and it worked. Thanks!

2) With the Database Trace Listener, I am still having problem. I am not sure how should my custom tables and stored procedures look like. I have created 2 tables and a package in my Oracle database as below:


CREATE TABLE CHAVALIS.CATEGORY
(
  ID    NUMBER                                  NOT NULL,
  NAME  VARCHAR2(100 BYTE)
);

CREATE TABLE CHAVALIS.LOG
(
  LOG_ID    INTEGER                             NOT NULL,
  EVENT_ID  INTEGER,
  MESSAGE   VARCHAR2(1500 BYTE)
);

CREATE OR REPLACE PACKAGE BODY CHAVALIS.ErrorLog
AS

PROCEDURE WriteLog
(
    p_EventID NUMBER,
    p_Message VARCHAR2
)
IS
BEGIN
    INSERT INTO Log (LOG_ID, EVENT_ID, MESSAGE)
VALUES (LOG_SEQ.nextval, p_EventID, p_Message);
END;

PROCEDURE AddCategory
(
    p_ID NUMBER,
    p_Name VARCHAR2
)
IS
BEGIN
    INSERT INTO Category (ID, Name)
VALUES (p_id, p_name);
END;

END ErrorLog;
/


And my Global.asax Application_Error looks as below:

    void Application_Error(object sender, EventArgs e)
    {
         ////Retrieve the last error in the website
        Exception objErr = Server.GetLastError().GetBaseException();
        ExceptionPolicy.HandleException(objErr, "Policy1");
       
        //Redirect the user to a friendly error page.
        Response.Redirect("~/Error.aspx", true);

        //additional actions...
        Server.ClearError();

    }

And my logging and exception configuration looks like below:

  <loggingConfiguration name="Logging Application Block" tracingEnabled="true"
    defaultCategory="EventLog Source" logWarningsWhenNoCategoriesMatch="true">
    <listeners>
      <add databaseInstanceName="Oracle ConnectionString" writeLogStoredProcName="CHAVALIS.ErrorLog.WriteLog"
        addCategoryStoredProcName="CHAVALIS.ErrorLog.AddCategory" formatter="Text Formatter"
        listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Database.Configuration.FormattedDatabaseTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging.Database, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        traceOutputOptions="None" filter="All" type="Microsoft.Practices.EnterpriseLibrary.Logging.Database.FormattedDatabaseTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging.Database, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        name="Database Trace Listener" />
      <add toAddress="suneela_chavali@jabil.com" fromAddress="suneela_chavali@jabil.com"
        subjectLineStarter="" subjectLineEnder="" smtpServer="localhost"
        smtpPort="25" formatter="Text Formatter" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.EmailTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        traceOutputOptions="None" filter="All" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.EmailTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        name="Email TraceListener" />
      <add source="Enterprise Library Logging" formatter="Text Formatter"
        log="Application" machineName="JGSREGIT10779.corp.jabil.org"
        listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FormattedEventLogTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        traceOutputOptions="None" filter="All" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FormattedEventLogTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        name="Formatted EventLog TraceListener" />
      <add fileName="C:\Suneela\Debug Logs\rolling.log" footer="----------------------------------------"
        formatter="Text Formatter" header="----------------------------------------"
        rollFileExistsBehavior="Overwrite" rollInterval="None" rollSizeKB="0"
        timeStampPattern="yyyy-MM-dd" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        traceOutputOptions="None" filter="All" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        name="Rolling FlatFile TraceListener" />
    </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.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        name="Text Formatter" />
    </formatters>
    <categorySources>
      <add switchValue="All" name="Database Source">
        <listeners>
          <add name="Database Trace Listener" />
        </listeners>
      </add>
      <add switchValue="All" name="FlatFile Source">
        <listeners>
          <add name="Rolling FlatFile TraceListener" />
        </listeners>
      </add>
      <add switchValue="All" name="Email Source">
        <listeners>
          <add name="Email TraceListener" />
        </listeners>
      </add>
      <add switchValue="All" name="EventLog Source">
        <listeners>
          <add name="Formatted EventLog TraceListener" />
        </listeners>
      </add>
    </categorySources>
    <specialSources>
      <allEvents switchValue="All" name="All Events" />
      <notProcessed switchValue="All" name="Unprocessed Category">
        <listeners>
          <add name="Email TraceListener" />
        </listeners>
      </notProcessed>
      <errors switchValue="All" name="Logging Errors &amp; Warnings">
        <listeners>
          <add name="Email TraceListener" />
        </listeners>
      </errors>
    </specialSources>
  </loggingConfiguration>
  <exceptionHandling>
    <exceptionPolicies>
      <add name="Policy1">
        <exceptionTypes>
          <add type="System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
            postHandlingAction="NotifyRethrow" name="Exception">
            <exceptionHandlers>
              <add logCategory="EventLog Source" eventId="100" severity="Error"
                title="Enterprise Library Exception Handling" formatterType="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
                priority="0" useDefaultLogger="false" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
                name="EventLog Handler" />
              <add logCategory="FlatFile Source" eventId="100" severity="Error"
                title="Enterprise Library Exception Handling" formatterType="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
                priority="0" useDefaultLogger="false" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
                name="FlaFile Handler" />
            </exceptionHandlers>
          </add>
          <add type="System.Web.Services.Protocols.SoapException, System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
            postHandlingAction="NotifyRethrow" name="SoapException">
            <exceptionHandlers>
              <add logCategory="Email Source" eventId="100" severity="Error"
                title="Enterprise Library Exception Handling" formatterType="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
                priority="0" useDefaultLogger="false" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
                name="Email Handler" />
              <add logCategory="Database Source" eventId="100" severity="Error"
                title="Enterprise Library Exception Handling" formatterType="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
                priority="0" useDefaultLogger="false" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
                name="Database Handler" />
            </exceptionHandlers>
          </add>
        </exceptionTypes>
      </add>
    </exceptionPolicies>
  </exceptionHandling>
  <dataConfiguration defaultDatabase="Connection String" />
  <connectionStrings>
    <add name="Connection String" connectionString="Database=Database;Server=(local)\SQLEXPRESS;Integrated Security=SSPI"
      providerName="System.Data.SqlClient" />
    <add name="Oracle ConnectionString" connectionString="user id=WebAppAMS;data source=RNRSTG;password=CKL1@$12!%"
      providerName="System.Data.OracleClient" />
  </connectionStrings>

  

When there is only "Email Hander" to my SoapException of Policy1, it was handled good. But, when I added "Database Handler", not even the Email Handler is working.

I am also sending you the files to your email: entlib.support@avanade.com with subject "Database Trace Listener".

Please let me know what is that I am missing. 

Thanks a lot for your patience and support.

-Suneela.

     

May 18, 2010 at 4:19 PM
Hi Sarah,
I realized the mistake i did. Instead of adding reference (Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.dll, etc) to my Project bin folder, I did "Add Existing Item" which resulted in Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.xml not being added to bin. That was the issue. So, i fixed it, it is worked as good as before.
1) Now, i am able to log exceptions in different ways, ex: log SoapException to Email and others to EventLog. I followed the process you mentioned and it worked. Thanks!
2) With the Database Trace Listener, I am still having problem. I am not sure how should my custom tables and stored procedures look like. I have created 2 tables and a package in my Oracle database as below:

CREATE TABLE CHAVALIS.CATEGORY
(
ID NUMBER NOT NULL,
NAME VARCHAR2(100 BYTE)
);

CREATE TABLE CHAVALIS.LOG
(
LOG_ID INTEGER NOT NULL,
EVENT_ID INTEGER,
MESSAGE VARCHAR2(1500 BYTE)
);

CREATE OR REPLACE PACKAGE BODY CHAVALIS.ErrorLog
AS

PROCEDURE WriteLog
(
p_EventID NUMBER,
p_Message VARCHAR2
)
IS
BEGIN
INSERT INTO Log (LOG_ID, EVENT_ID, MESSAGE)
VALUES (LOG_SEQ.nextval, p_EventID, p_Message);
END;

PROCEDURE AddCategory
(
p_ID NUMBER,
p_Name VARCHAR2
)
IS
BEGIN
INSERT INTO Category (ID, Name)
VALUES (p_id, p_name);
END;

END ErrorLog;
/


And my Global.asax Application_Error looks as below:
    void Application_Error(object sender, EventArgs e)
    {
         ////Retrieve the last error in the website
        Exception objErr = Server.GetLastError().GetBaseException();
        ExceptionPolicy.HandleException(objErr, "Policy1");
       
        //Redirect the user to a friendly error page.
        Response.Redirect("~/Error.aspx", true);

        //additional actions...
        Server.ClearError();

    }

And my logging and exception configuration looks like below:
  <loggingConfiguration name="Logging Application Block" tracingEnabled="true"
    defaultCategory="EventLog Source" logWarningsWhenNoCategoriesMatch="true">
    <listeners>
      <add databaseInstanceName="Oracle ConnectionString" writeLogStoredProcName="CHAVALIS.ErrorLog.WriteLog"
        addCategoryStoredProcName="CHAVALIS.ErrorLog.AddCategory" formatter="Text Formatter"
        listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Database.Configuration.FormattedDatabaseTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging.Database, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        traceOutputOptions="None" filter="All" type="Microsoft.Practices.EnterpriseLibrary.Logging.Database.FormattedDatabaseTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging.Database, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        name="Database Trace Listener" />
      <add toAddress="suneela_chavali@jabil.com" fromAddress="suneela_chavali@jabil.com"
        subjectLineStarter="" subjectLineEnder="" smtpServer="localhost"
        smtpPort="25" formatter="Text Formatter" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.EmailTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        traceOutputOptions="None" filter="All" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.EmailTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        name="Email TraceListener" />
      <add source="Enterprise Library Logging" formatter="Text Formatter"
        log="Application" machineName="JGSREGIT10779.corp.jabil.org"
        listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FormattedEventLogTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        traceOutputOptions="None" filter="All" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FormattedEventLogTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        name="Formatted EventLog TraceListener" />
      <add fileName="C:\Suneela\Debug Logs\rolling.log" footer="----------------------------------------"
        formatter="Text Formatter" header="----------------------------------------"
        rollFileExistsBehavior="Overwrite" rollInterval="None" rollSizeKB="0"
        timeStampPattern="yyyy-MM-dd" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        traceOutputOptions="None" filter="All" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        name="Rolling FlatFile TraceListener" />
    </listeners>
    <formatters>
      <add template="Timestamp: {timestamp}
Message: {message}
Category: {category}
Priority: {priority}
EventId: {eventid}
Severity: {severity}
Title:{title}
Machine: {machine}
Application Domain: {appDomain}
Process Id: {processId}
Process Name: {processName}
Win32 Thread Id: {win32ThreadId}
Thread Name: {threadName}
Extended Properties: {dictionary({key} - {value}
)}"
        type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        name="Text Formatter" />
    </formatters>
    <categorySources>
      <add switchValue="All" name="Database Source">
        <listeners>
          <add name="Database Trace Listener" />
        </listeners>
      </add>
      <add switchValue="All" name="FlatFile Source">
        <listeners>
          <add name="Rolling FlatFile TraceListener" />
        </listeners>
      </add>
      <add switchValue="All" name="Email Source">
        <listeners>
          <add name="Email TraceListener" />
        </listeners>
      </add>
      <add switchValue="All" name="EventLog Source">
        <listeners>
          <add name="Formatted EventLog TraceListener" />
        </listeners>
      </add>
    </categorySources>
    <specialSources>
      <allEvents switchValue="All" name="All Events" />
      <notProcessed switchValue="All" name="Unprocessed Category">
        <listeners>
          <add name="Email TraceListener" />
        </listeners>
      </notProcessed>
      <errors switchValue="All" name="Logging Errors & Warnings">
        <listeners>
          <add name="Email TraceListener" />
        </listeners>
      </errors>
    </specialSources>
  </loggingConfiguration>
  <exceptionHandling>
    <exceptionPolicies>
      <add name="Policy1">
        <exceptionTypes>
          <add type="System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
            postHandlingAction="NotifyRethrow" name="Exception">
            <exceptionHandlers>
              <add logCategory="EventLog Source" eventId="100" severity="Error"
                title="Enterprise Library Exception Handling" formatterType="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
                priority="0" useDefaultLogger="false" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
                name="EventLog Handler" />
              <add logCategory="FlatFile Source" eventId="100" severity="Error"
                title="Enterprise Library Exception Handling" formatterType="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
                priority="0" useDefaultLogger="false" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
                name="FlaFile Handler" />
            </exceptionHandlers>
          </add>
          <add type="System.Web.Services.Protocols.SoapException, System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
            postHandlingAction="NotifyRethrow" name="SoapException">
            <exceptionHandlers>
              <add logCategory="Email Source" eventId="100" severity="Error"
                title="Enterprise Library Exception Handling" formatterType="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
                priority="0" useDefaultLogger="false" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
                name="Email Handler" />
              <add logCategory="Database Source" eventId="100" severity="Error"
                title="Enterprise Library Exception Handling" formatterType="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
                priority="0" useDefaultLogger="false" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
                name="Database Handler" />
            </exceptionHandlers>
          </add>
        </exceptionTypes>
      </add>
    </exceptionPolicies>
  </exceptionHandling>
  <dataConfiguration defaultDatabase="Connection String" />
  <connectionStrings>
    <add name="Connection String" connectionString="Database=Database;Server=(local)\SQLEXPRESS;Integrated Security=SSPI"
      providerName="System.Data.SqlClient" />
    <add name="Oracle ConnectionString" connectionString="user id=WebAppAMS;data source=RNRSTG;password=CKL1@$12!%"
      providerName="System.Data.OracleClient" />
  </connectionStrings>

  
When there is only "Email Hander" to my SoapException of Policy1, it was handled good. But, when I added "Database Handler", not even the Email Handler is working.
I am also sending you the files to your email: entlib.support@avanade.com with subject "Database Trace Listener".
Please let me know what is that I am missing.
Thanks a lot for your patience and support.
-Suneela.




From: [email removed]
To: [email removed]
Date: Mon, 17 May 2010 20:30:49 -0700
Subject: Re: Email TraceListener not working [entlib:61770]

From: AvanadeSupport
I did not receive any email so I wasn't able to check your attachments. What is your OS? Does the app used to log before? Configure a trace listener under the Logging Errors and Warnings so that if any logging fails, it will log information regarding why the logging failed. Check also this entlib faq for other suggestions- http://entlib.codeplex.com/wikipage?title=Why%20are%20messages%20not%20logged%3f&referringTitle=EntLib%20FAQ.


Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

Read the full discussion online.
To add a post to this discussion, reply to this email (entlib@discussions.codeplex.com)
To start a new discussion for this project, email entlib@discussions.codeplex.com
You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.
Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com


The New Busy is not the too busy. Combine all your e-mail accounts with Hotmail. Get busy.
May 19, 2010 at 2:24 AM

If you want to use the Formatted Database Trace Listener that ships with entlib, you should use the same schema of the logging tables that comes with it.  The script is only for sql so you need to convert it to oracle.  The script can be found in the entlib source code folder - \EntLib41Src\Blocks\Logging\Src\DatabaseTraceListener\Scripts.

 

Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

May 19, 2010 at 7:39 PM

Hi Sarah,

You are right. I created my database objects same exactly as listed for SQL Server. I got the Oracle Database scripts from

http://jopinblog.wordpress.com/2007/05/21/enterprise-library-logging-to-oracle-database/

and it worked amazingly with the Database Trace Listener.

Thanks,

Suneela.

May 20, 2010 at 4:40 PM
One more question!
Is there away to turn on/off exception policy?

-Suneela.

From: [email removed]
To: [email removed]
Date: Tue, 18 May 2010 18:24:19 -0700
Subject: Re: Email TraceListener not working [entlib:61770]

From: AvanadeSupport
If you want to use the Formatted Database Trace Listener that ships with entlib, you should use the same schema of the logging tables that comes with it. The script is only for sql so you need to convert it to oracle. The script can be found in the entlib source code folder - \EntLib41Src\Blocks\Logging\Src\DatabaseTraceListener\Scripts.

Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

Read the full discussion online.
To add a post to this discussion, reply to this email (entlib@discussions.codeplex.com)
To start a new discussion for this project, email entlib@discussions.codeplex.com
You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.
Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com


Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox. Learn more.
May 21, 2010 at 1:48 AM

There isn't.  If you need that behavior, you can have a setting in your config file which enable/disable exceptionhandling and have a helper method which checks for that setting.

By the way, for new topics/questions, please create a new discussion.

 

Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

May 21, 2010 at 1:20 PM
ok Thanks!


From: [email removed]
To: [email removed]
Date: Thu, 20 May 2010 17:48:19 -0700
Subject: Re: Email TraceListener not working [entlib:61770]

From: AvanadeSupport
There isn't. If you need that behavior, you can have a setting in your config file which enable/disable exceptionhandling and have a helper method which checks for that setting.
By the way, for new topics/questions, please create a new discussion.

Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

Read the full discussion online.
To add a post to this discussion, reply to this email (entlib@discussions.codeplex.com)
To start a new discussion for this project, email entlib@discussions.codeplex.com
You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.
Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com


The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with Hotmail. Get busy.