you can use an interceptor to do this:
public class LoggingInterceptor : EmptyInterceptor {
public override SqlString OnPrepareStatement(SqlString sql) {
Debug.WriteLine(sql);
return sql;
}
}
See Nhibernate Docs for the different ways to register it with nhibernate.