-
Notifications
You must be signed in to change notification settings - Fork 8
Logging
Vlad_Raven edited this page Jul 25, 2017
·
4 revisions
You can logging with Realmius by implement Realmius.ILogger interface and set object of this class to configuration.
ILogger interface:
public interface ILogger
{
void Exception(Exception ex, string text = null);
void Info(string text);
void Debug(string text);
}
On server side the logger class must implement the Realmius.Server.Infrastructure.ILogger interface, which looks the same as Realmius.ILogger above. Setting the logger implements in advanced server configuration by overriding the RealmiusConfigurationBase<T>.Logger property.
public class RealmiusServerAuthConfiguration : RealmiusConfigurationBase<User>
{
public RealmiusServerAuthConfiguration() : base(() => new RealmiusServerContext())
{
}
public override ILogger Logger { get; set; } = new Logger();
...
}
To see what's being logged, you could plug in our own ConsoleLogger on server side (you will see logs in Output window during debug):
public override ILogger Logger { get; set; } = new ConsoleLogger();