Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Further abstract the internal logging code. #76

Open
kfogel opened this issue Jul 28, 2016 · 0 comments
Open

Further abstract the internal logging code. #76

kfogel opened this issue Jul 28, 2016 · 0 comments

Comments

@kfogel
Copy link
Member

kfogel commented Jul 28, 2016

The code to do informational logging (see the commit 634fcbe merge) is a bit repetitive and could be further abstracted. Basically, we should create src/main/java/org/openhmis/util/LogUtil.java providing a new a LogUtil class, with at least these three methods:

public static logNamedEntity(String method, String endpoint, Int id) { ... }
public static logCreation(String method, String endpoint, Int newId { ... }
public static logResultSet(String method, String endpoint, Int numResults) { ... }

corresponding respectively to:

log.info("GET /clients/" + clientId);
log.info("POST /clients (new id: " +  newClientId + ")");
log.info("GET /clients (" + clientList.size + " results)");

(Well, we might also need a method or two to handle authn event logging specially.)

Then we could add more methods as we need them, and be assured that our log format would always be consistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant