Current filter:
                                You should refresh the page.
                                Support Center
                                0
                                  • Hi,
                                    As a XAF developer, it would be nice to have tsome guidelines to replace XAF exception handling with logify

                                    Thanks

                                    Gustavo

                                1 Solution

                                Creation Date Rating Importance Sort by
                                0

                                Hello Gustavo,

                                You can learn more on the XAF default exception handling mechanism and its extensibility points from the Concepts > Debugging and Error Handling article and related ones.
                                Here is also the documentation on the Logify-specific code: WinForms, ASP.NET. For instance, you can use the LogifyAlert.Send(Exception e) method for manual reporting.

                                for your tasks.
                                 Should you experience any Logify-specific questions, please contact the corresponding team directly (Startups > Logify | Crash Report).


                                That said, consider the following XAF integration options:

                                1. Create a custom Tracing class and override its LogError and other LogXXX methods to call the Logify-specific integration code. The Concepts > Debugging and Error Handling > Add Custom Log Entries and Customize the Default Tracer Behavior  article describes the XAF part in detail. 


                                2. Disable the XAF logging mechanism in the application configuration file (<add name="eXpressAppFramework" value="0" />) and insert the Logify integration code into the following places in your XAF app:

                                WinForms (YourSolutionName.Win/Program.xx):

                                [C#]
                                ... try { winApplication.Setup(); winApplication.Start(); } catch(Exception exception) { //Insert your Logify exception logging code here. winApplication.HandleException(exception); } ...


                                ASP.NET WebForms (YourSolutionName.Web/Global.asax.xx):

                                [C#]
                                ... protected void Application_Error(object sender, EventArgs e) { if(HttpContext.Current != null) { Exception exception = HttpContext.Current.Server.GetLastError(); //Insert your Logify exception logging code here. } ErrorHandling.Instance.ProcessApplicationError(); } ...


                                3. Another XAF integration option would be replacing the default System.Diagnostics.TextWriterTraceListener class used by the Tracing class internally with a custom trace listener (How to: Create and Initialize Trace Listeners (MSDN)), but this appears to be a more complex and less flexible path, because  you will have to deal with text values instead of System.Exception objects. 

                                Logify also provides a ready to use LogifyAlertTraceListener API, so it is possible that you may find it helpful to replace diagnostic messages output with the default eXpressAppFramework.log file.



                                We do not currently have a ready XAF example or free support resources to create it right away, so we would greatly appreciate it if you inform us of your results as you implement this task in your project.
                                I would also kindly ask you to make this ticket public, if possible, because other XAF community members may be interested in this guidance as well. Thanks for your cooperation in advance.

                                Show all comments
                                • Gustavo Marzioni 01.19.2017
                                  sure Dennis, make it public!
                                • Thanks, published.
                                • in the simplest case do this:

                                  winapplication:
                                  protected override void HandleExceptionCore(Exception e) {     
                                  base.HandleExceptionCore(e);     
                                  LogifyAlert.Instance.Send(e); }
                                • Thanks for your update, Noxe. I have mentioned this option as well.
                                • Taradanov 01.20.2017
                                  I hope there will be some built-in way to easily use Logify in the future.
                                • @Taradanov: Would you please describe what you find difficult about these approaches and, preferably, describe how you would like to get this integration task done instead? Thanks in advance.

                                • Michael Gibson - PatTrac 03.02.2017
                                  are you saying to change

                                  [C#]
                                  <system.diagnostics> <switches> <!-- Use the one of predefined values: 0-Off, 1-Errors, 2-Warnings, 3-Info, 4-Verbose. The default value is 3. --> <add name="eXpressAppFramework" value="3" /> </switches> </system.diagnostics>
                                  the value to 0? or 4?
                                • @Michael: Thanks for finding a typo. Yes, I meant 0 in point #2.

                                If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

                                FOLLOW US

                                DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, ASP.NET, WinForms, HTML5 or Windows 10, DevExpress tools help you build and deliver your best in the shortest time possible.

                                Copyright © 1998-2017 Developer Express Inc.
                                All trademarks or registered trademarks are property of their respective owners