EnterpriseLibrary, LogCallHandler and Windows Form...

Topics: User Discussion
Nov 2, 2010 at 4:45 PM

Hi,

I try to use the EnterpriseLibrary to add log to my application using LogCallHandler.

It is working great with class, for exemple : 

 

[LogCallHandler(LogBeforeCall=false)]

    public class Class1 : MarshalByRefObject

    {

 

....

     }

Class1 myClass = InjectionHelper.Create<Class1>();

But it is possible to use this method with a Form ?? I tried, but this does not work. I wish to trace all calls to methods in my form. For exemple : 

 

 

    [LogCallHandler(LogBeforeCall = false)]

    public partial class Form1 : Form

    {

...

 

 

        private void Form1_Load(object sender, EventArgs e)

        {

...

        }

 

...

     }

And trace what append in Form1_Load, for exemple an exception.

If anyone has an idea, I'm interested !

Thank you very much for your help.