How I can create a log for web services in a dynamic web project in Java? -
i'm having problem creating own logs application i'm developing in work, next code have works running in single class method main.
try { logmanager lm = logmanager.getlogmanager(); logger logger; filehandler fh = new filehandler(filelogger,true); logger = logger.getlogger(filelogger); lm.addlogger(logger); logger.setlevel(level); fh.setformatter(new simpleformatter()); logger.log(level, message); logger.addhandler(fh); fh.close(); } catch (exception e) { system.out.println("exception thrown: " + e); e.printstacktrace(); }
but, when want call function in doget webservice, log appended in catalina log , not in 1 i'm creating. know catalina appends information of call webservice but, how can create new log calls want?
thanks!!
you should looking @ logging frameworks log4j , logback gives lot of flexibility in logging. used log create own log files.
Comments
Post a Comment