a logger and a printStackTrace in Java
Hello:
I have a simple class logger, for applications and keep a log of exceptions: Code:
import java.io.*; Logger.log(e.printStackTrace()); I've been using the e.getMessage() and the e.toString() but it's not quite the same Please Help! Thanks a lot Poeta |
I'm not sure if it works, but if you do a
StackTraceElements[] array = exception.getStackTrace(); And then you cycle through each element of the array, executing the following instruction in each cycle: Logger.log(array[i].toString()); I think that should do the job right? |
Hola paisano!!
Si funcionó, muchisimas gracias :) Ahora solo tengo que pelearme con el sql jajaja de casualidad no sabrás que significa el SQLState keycode: S1000 ??? poeta ----------------------------------------- It did work, thanks a lot! now I just have to struggle with this sql thing.... any idea what SQLState keycode: S1000 stands for? I'm using mySql and org.gjt.mm.mysql.Driver as a driver for Java Thanks a lot! |
All times are GMT -5. The time now is 10:22 AM. |