APISonar


io.seldon.api.service.ApiLoggerServer.log

> io > seldon > api > service > ApiLoggerServer > log
io APIs seldon APIs api APIs service APIs ApiLoggerServer APIs log APIs

Example 1
public ResourceBean updateItem(ConsumerBean consumerBean, ItemBean itemBean) {
        ResourceBean responseBean;
        try {
            itemService.updateItem((ConsumerBean) consumerBean, itemBean);
            responseBean = itemBean;
        } catch (APIException e) {
            ApiLoggerServer.log(this, e);
            responseBean = new ErrorBean(e);
        } catch (Exception e) {
            ApiLoggerServer.log(this, e);
            APIException apiEx = new APIException(APIException.INCORRECT_FIELD);
            responseBean = new ErrorBean(apiEx);
        }
        return responseBean;
    }
Example 2
public void saveToken(final Token token) throws APIException {
		try {
	    	final PersistenceManager pm =  jdoFactory.getPersistenceManager(Constants.API_DB);
			TransactionPeer.runTransaction(new Transaction(pm) { 
			    public void process()
			    { 
					pm.makePersistent(token);
			    }
			});
		}
		catch (DatabaseException e) {
			ApiLoggerServer.log(new TokenPeer(), e);
			throw new APIException(APIException.INTERNAL_DB_ERROR);
		}
	}