-
Notifications
You must be signed in to change notification settings - Fork 0
log
nimamoosavi edited this page Aug 6, 2021
·
2 revisions
This annotation used Aop (Aspect Oriented Programing ) For Log Data In Kafka Or File Or Elastic Search and ..
this CrossCutting Implement in Audit Project that You Can Add To your Project And Log Data
<dependency>
<groupId>app.ladderproject</groupId>
<artifactId>audit</artifactId>
<version>1.0.2-Release</version>
</dependency>
Guide
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD})
public @interface Log {
AuditFactory.AuditType type() default AuditFactory.AuditType.ALL;
Log annotation has one Attribute that you can set How To Log
- BEFORE ( before the methode Run ...)
- AFTER_RETURNING (After the Result back ...)
- AFTER_TROWING (If the methode throw Exception)
- All ( default )
package app.ladderproject.aggregation.integration.service;
import app.ladderproject.aggregation.integration.view.req.AffairReqVM;
import app.ladderproject.aggregation.integration.view.res.AffairResVM;
import app.ladderproject.client.service.impl.MicroClientService;
import app.ladderproject.framework.anotations.Log;
import app.ladderproject.framework.domain.dto.BaseDTO;
import app.ladderproject.framework.packages.audit.view.AuditFactory;
import org.springframework.stereotype.Service;
@Service
public class AffairService extends MicroClientService<AffairReqVM, AffairResVM, Long> {
@Override
@Log(type = AuditFactory.AuditType.AFTER_RETURNING)
public BaseDTO<AffairResVM> create(AffairReqVM affairReqVM) {
return super.create(affairReqVM);
}
}