...
Code Block |
---|
title | Use logger |
---|
collapse | true |
---|
|
public void doSomething(CRMDOAccountingPeriod accountingPeriod) throws Exception {
logger.debug("Invoked doSomething()");
...
} |
If the file does not extend CRMBase:
Code Block |
---|
title | Use logger |
---|
collapse | true |
---|
|
public void doSomething(CRMDOAccountingPeriod accountingPeriod) throws Exception {
Logger logger = LogUtil.getLogger(getCRMSession(), getClass());
logger.debug("Invoked doSomething()");
...
} |
If the file is not related to an organisation:
Code Block |
---|
title | Use logger |
---|
collapse | true |
---|
|
public void doSomething(CRMDOAccountingPeriod accountingPeriod) throws Exception {
Logger logger = LogUtil.getLogger(getClass());
logger.debug("Invoked doSomething()");
...
} |
If the method/file is asynchronous:
Code Block |
---|
title | Use logger |
---|
collapse | true |
---|
|
@Asynchronous
public void execute(@Observes(during=TransactionPhase.AFTER_SUCCESS) WorkflowRuleEvent event) {
setLogger(event.getSession());
logger.debug("Invoked execute()");
...
} |