use of org.qi4j.logging.log.records.EntityLogRecord in project qi4j-sdk by Qi4j.
the class LoggingServiceMixin method createLogRecord.
private void createLogRecord(UnitOfWork uow, LogType type, Composite composite, String category, String message, List<Serializable> params) {
if (composite instanceof ServiceComposite) {
EntityBuilder<ServiceLogRecord> builder = uow.newEntityBuilder(ServiceLogRecord.class);
ServiceLogRecord state = builder.instance();
setStandardStuff(type, composite, category, message, state, params);
state.source().set(((ServiceComposite) composite).identity().get());
ServiceLogRecord slr = builder.newInstance();
} else if (composite instanceof EntityComposite) {
EntityBuilder<EntityLogRecord> builder = uow.newEntityBuilder(EntityLogRecord.class);
EntityLogRecord state = builder.instance();
setStandardStuff(type, composite, category, message, state, params);
state.source().set((EntityComposite) composite);
EntityLogRecord elr = builder.newInstance();
} else {
EntityBuilder<CompositeLogRecord> builder = uow.newEntityBuilder(CompositeLogRecord.class);
CompositeLogRecord state = builder.instance();
setStandardStuff(type, composite, category, message, state, params);
state.source().set(composite);
CompositeLogRecord clr = builder.newInstance();
}
}
Aggregations