I think I have solved it. I use in essence this for Log4Net interop:
[DependencyInjectionInfo(typeof(IEntity2), "AuditorToUse")]
[Serializable]
public class GeneralAuditor : AuditorBase
{
private static readonly ILog Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public override void AuditDeleteOfEntity(IEntityCore entity)
{
Log.InfoFormat("Entity: {0} Action: Delete", entity.LLBLGenProEntityName);
}
public override void AuditDereferenceOfRelatedEntity(IEntityCore entity, IEntityCore relatedEntity, string mappedFieldName)
{
string info = string.Format("RelatedEntityName: {0}. MappedFieldName: {1}", relatedEntity.LLBLGenProEntityName, mappedFieldName);
Log.InfoFormat("Entity: {0} Action: Reference Info: {1}", entity.LLBLGenProEntityName, info);
}
public override void AuditInsertOfNewEntity(IEntityCore entity)
{
Log.InfoFormat("Entity: {0} Action: InsertOfNewEntity", entity.LLBLGenProEntityName);
}
public override void AuditReferenceOfRelatedEntity(IEntityCore entity, IEntityCore relatedEntity, string mappedFieldName)
{
string info= string.Format("RelatedEntityName: {0}. MappedFieldName: {1}", relatedEntity.LLBLGenProEntityName, mappedFieldName);
Log.InfoFormat("Entity: {0} Action: ReferenceOfRelatedEntity Info: {1}", entity.LLBLGenProEntityName,info);
}
public override void AuditUpdateOfExistingEntity(IEntityCore entity)
{
Log.InfoFormat("Entity: {0} Action: UpdateOfExistingEntity", entity.LLBLGenProEntityName);
}
}