logging - Source code link in log in NetBeans IDE / Java -
when program prints stack trace in netbeans ide, example this:
exception in thread "main" java.lang.runtimeexception: not implemented yet @ app.app.main(app.java:202)
the "app.java:202" part link. when click it, directs me file , line.
i in own logs. printing doesn't work me.
my not functional log line example:
2015/06/01 10:27:19.197 (dbconnection.java:119) executequery ....
solution:
stacktraceelement s = thread.currentthread().getstacktrace()[1]; system.out.printf("%s.%s(%s:%s)%n", s.getclassname(), s.getmethodname(),s.getfilename(), s.getlinenumber());
new problem:
if print this:
app.app.runtests(app.java:128) th_id:1,main warn null database.dbvaluescache.run(dbvaluescache.java:153) ....
.. first link works.
what now?
Comments
Post a Comment