LoggerService Class
A service that allows you to log server-side errors and events related to client-side reporting controls.
Namespace: DevExpress.XtraReports.Web.ClientControls
Assembly: DevExpress.XtraReports.v17.2.Web.dll
NuGet Package: DevExpress.Web.Reporting
Declaration
Remarks
When working with the client-side reporting controls (Web Document Viewer, Report Designer and Query Builder), you can use the LoggerService class to handle exceptions that occur on the server side and log certain other operations (for instance, exporting documents, requests to open reports from the client side , etc.).
You can implement an action that processes exceptions and call the LoggerService.Initialize method overload accepting this action at the application startup.
using System;
void ProcessException(Exception ex, string message) {
// Log exceptions here.
}
void Application_Start(object sender, EventArgs e) {
// ...
DevExpress.XtraReports.Web.ClientControls.LoggerService.Initialize(ProcessException);
}
If you need to additionally obtain information on other operations, create your custom logger service by inheriting from the LoggerService class and overriding the virtual LoggerService.Info and LoggerService.Error methods:
using System;
public class MyLoggerService : DevExpress.XtraReports.Web.ClientControls.LoggerService {
public override void Info(string message) {
// ...
}
public override void Error(Exception exception, string message) {
// Log exceptions here.
}
}
To register a custom logger instance, use the LoggerService.Initialize method overload accepting the logger object at the application startup.
using System;
void Application_Start(object sender, EventArgs e) {
// ...
DevExpress.XtraReports.Web.ClientControls.LoggerService.Initialize(new MyLoggerService());
}