I was wondering if someone could help with a little trick I wanted to do with the System.out.println in my Java classes.
Basically in Websphere, you don;t get a date/time before any system outs in your log files, which i would like, so I was wondering if anyone knew of a way I could tell 'Java' to oput the date/time on the start of any System.out. I've got a date format sorted:
Date today = new Date(); SimpleDateFormat sysDate = new SimpleDateFormat ("dd.mm.yyyy' at 'HH.mm.ss' -- '"); String strSystemDate = sysDate.format(today);
But what I don't want to have to do is put System.out.println(strSystemDate+"something else here..."); in every System.out
I was wondering if there is a way of saying, if System.out then start with strSystemDate. I know it sounds a little daft but iot would really help with my logging.