i am catching exception and want to log these too. (->printStackTrace(PrintStream or PrintWriter) ), i need a way to retrieve a PrintStream or PrintWriter of my logger.
is that possible?
otherwise i would need to build a utility method to log exceptions by using Logger.getStackTrace()...
All of the logging methods in log4j (info, error, and so on) have overloaded versions that accept an Exception parameter. What's wrong with using those methods?
i must have been blind... in the first place i only tried to use following which just showed me the expception but not the stack trace: ... catch(Exception e){ logger.error(e); }
but there is a overloaded logger method error(Object,Exception) too