Subversion Repository Public Repository

Pharmacy_09_03_18

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bestray.healthcareemr.Util;

import org.apache.log4j.Logger;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Aspect;

/**
 *
 * @author Bitu
 */
@Aspect
public class LoggerAspect {
    
    static Logger logger = Logger.getLogger(Logger.class);
    
//Dao log Class
     
    public void daologAfterThrowing(JoinPoint joinPoint, Throwable error) {
        logger.error("Error In Dao- "+joinPoint.getSignature().getName(), error);
    }
    
    public void daologAfterReturning(JoinPoint joinPoint, Object result) {
	logger.info("Dao Values Returned- "+joinPoint.getSignature().getName());
    }
    
    public Object daologAround(ProceedingJoinPoint joinPoint) throws Throwable {
        logger.info("Dao Process starting- "+joinPoint.getSignature().getName());
        Object result = joinPoint.proceed();
        logger.info("Dao Process Completed- "+joinPoint.getSignature().getName());
        return result;
    }
    
//Service Class Log
        
    public void servicelogAfterThrowing(JoinPoint joinPoint, Throwable error) {
        logger.error("Error In Service- "+joinPoint.getSignature().getName(), error);
    }
    
    public void servicelogAfterReturning(JoinPoint joinPoint, Object result) {
	logger.info("Service Values Returned- "+joinPoint.getSignature().getName());
    }
    
    public Object servicelogAround(ProceedingJoinPoint joinPoint) throws Throwable {
        logger.info("Service Process starting- "+joinPoint.getSignature().getName());
        Object result = joinPoint.proceed();
        logger.info("Service Process Completed- "+joinPoint.getSignature().getName());
        return result;
    }
      
}

Commits for Pharmacy_09_03_18/Dr Gyana ProjectSpace/DrGyanaEMR/src/main/java/com/bestray/healthcareemr/Util/LoggerAspect.java

Diff revisions: vs.
Revision Author Commited Message
1 girijabapi picture girijabapi Fri 27 Jul, 2018 07:30:57 +0000