I could log queries using Interceptor but paramerters are not being logged.

-------


public class NhibernateQueryLogger : EmptyInterceptor
{
    private Logger _logger;
    public NhibernateQueryLogger()
    {
        _logger = new 
LoggerConfiguration().WriteTo.RollingFile("logs/nhibernate-log-{Date}.txt").CreateLogger();
    }

    public override SqlString OnPrepareStatement(SqlString sql)
    {
        _logger.Information(sql.ToString());
        return base.OnPrepareStatement(sql);
    }
}

-----------------

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nhusers/5f25ea1b-543a-4748-a426-eff40023eafen%40googlegroups.com.

Reply via email to