← Back to team overview

dhis2-devs team mailing list archive

Re: [Branch ~dhis2-devs-core/dhis2/trunk] Rev 1785: Audit trail logging functions for DataSet, OrganisationUnit, User modules.

 

Hi Viet

This is excellent.

When we first started discussing using logging framework for audit you
pointed out that logging is most commonly used for system
info/diagnostics/debugging.  Which is true.  Of course logging works
pretty well for audit as well, but I was thinking (influenced by
http://www.mail-archive.com/general@xxxxxxxxxxxxxxxxxx/msg00747.html)
that it makes sense to use a distinct logger, rather than one based
after the class name, for this.

So for example instead of where you have:
private Logger logger = Logger.getLogger( getClass() );

I was thinking something more like
private Logger audit_logger = Logger.getLogger( AUDIT_LOG ); // where
AUDIT_LOG is a globally accessible string

Or considering that the audit_logger could be thought of as a
singleton throughout the system, just use a setter and configure by
spring.  Or a static getLogger method on a simple AuditLogger class.

However, I see you have extended Level to produce a new AUDIT_LEVEL
and routed that to a distinct log appender which I can see also works
well to manage the output of logging in a discriminatory way.  That's
pretty cool.  I'm still in two minds whether the enabling of audit
should be related to the debug level you want to have on diagnostics
though.  I might reasonably want to turn audit off and debug on for
example.  For which I'd want a distinct audit logger.  Maybe that's
not reasonable.

What do you think?

Cheers
Bob

On 19 April 2010 10:56,  <noreply@xxxxxxxxxxxxx> wrote:
> ------------------------------------------------------------
> revno: 1785
> committer: Viet <Viet@Viet-Laptop>
> branch nick: trunk
> timestamp: Mon 2010-04-19 16:54:45 +0700
> message:
>  Audit trail logging functions for DataSet, OrganisationUnit, User modules.
> added:
>  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/AuditLogLevel.java
>  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/AuditLogUtil.java
> modified:
>  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataset/DefaultDataSetService.java
>  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitService.java
>  dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml
>  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientService.java
>  dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml
>  dhis-2/dhis-services/dhis-service-user-hibernate/src/main/java/org/hisp/dhis/user/hibernate/HibernateUserStore.java
>  dhis-2/dhis-services/dhis-service-user-hibernate/src/main/resources/META-INF/dhis/beans.xml
>  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/WEB-INF/classes/log4j.properties
>  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/util/validate/additional-methods.js
>  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/util/validate/jquery.validate.js
>  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/addSection.vm
>  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/addOrganisationUnitGroupSetForm.vm
>  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/updateOrganisationUnitGroupSetForm.vm
>  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/AddPatientAction.java
>  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/ValidatePatientAction.java
> The size of the diff (1144 lines) is larger than your specified limit of 1000 lines
>
> --
> lp:dhis2
> https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
>
> Your team DHIS 2 developers is subscribed to branch lp:dhis2.
> To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help   : https://help.launchpad.net/ListHelp
>



Follow ups

References