added errorlog function which uses Java error logging API