devexpresspostsharpdevexpress-wpflogify

How to use DevExpress Logify with Postsharp 5.0 Logging along with Serilog


DevExpress Logify supports SeriLog and logs all fatal erros to its server. According to their document when ever serilog logs an error it will automatically trigger Logify as follows

 Log.Logger = new LoggerConfiguration()
            .WriteTo.Seq("http://localhost:5341").MinimumLevel.Error()
            .WriteTo.Console(LogEventLevel.Error)
            .WriteTo.LogifyAlert()
            .ReadFrom.AppSettings()
            .CreateLogger();

its working fine when using Serilog but the moment I use postsharp the event is not logged.

  LoggingServices.DefaultBackend = new SerilogLoggingBackend();

How can I solve this?


Solution

  • According to the aforementioned link, currently, it is necessary to access the LogifyAlert.Instance property before creating LoggerConfiguration to initialize a Logify engine inside a plugin.

    LogifyAlert client = LogifyAlert.Instance;
    ...
    Log.Logger = new LoggerConfiguration();