import org.apache.commons.logging.*; class DocumentDAOImpl implements DocumentDAO { static private final Log log = LogFactory.getLog(DocumentDAOImpl.class); public void deleteDocument(String id) { // ... log.debug(';deleting document: '; + id); // ... try { // ... data operations ... } catch (SomeException ex) { log.error(';Unable to delete document'; ex); // ... handle the exception ... } } } |