Re: System.out is repeating the output
Re: System.out is repeating the output
- Subject: Re: System.out is repeating the output
- From: Kieran Kelleher <email@hidden>
- Date: Tue, 16 Nov 2004 12:59:10 -0500
Nathan ... don't worry about it. Java is a subset of WO ... or WO is an extension of java .... either way, this a friendly WO community that programs in java!
While I am certainly no expert at log4j, it seems that log4j does exactly what you want, even selectively for different types of errors. I just use it for logging debug stuff during development to a file which was pretty simple to setup. Log4j allows you to specify various output streams for differnt types and levels of log messages (file, rolling file, database, SMTP, etc.). One way to configure logging is in a log4j properties text file which you initialize in Application constructor. After that you just create an instance of Logger in each class and use log.debug("message", optional throwable), log.info(...), log.warn(...), etc. statements to output the messages to the logger framework which uses the properties in your configuration file to determine where the messages go (a file, SMTP, etc.). Plus for deployment, you cna change the properties file to stop or minimize the cpu-hogging-logging !
For more info see here:
http://logging.apache.org/log4j/docs/manual.html
http://logging.apache.org/log4j/docs/api/index.html
http://logging.apache.org/log4j/docs/index.html
Regards, Kieran
________________________________________________________________
Dev Config = OS X 10.3.5 / Java 1.4.2_05 / WO 5.2.3 / XCode v1.5 / MySQL 4.0.20 / Connector-J 3.0.11
Deploy Config = OS X 10.3.5 Server / Java 1.4.2_05 / WO 5.2.3 / MySQL 4.0.20 / Connector-J 3.0.11
My Blog: http://webobjects.webhop.org/
On Nov 16, 2004, at 9:21 AM, Nathan Dumar wrote:
I know, this question is not specifically WO. I apologize. This started as a WO question, when I wanted to email all exceptions to myself. I went with a suggestion to use System.out, because I would be sure to get almost everything that way (some exceptions, as Chuck stated, can't be caught, like OOM). Now my question is not specifically about WO, but I'm continuing to go back to this list, because here is where I started this approach for solving a problem in my WO app.
I didn't mean "double" as in the variable type. I meant repeated. If you look at the output I get from the code, you'll see that it spit out twice as much as it was supposed to produce. It should say this:
write 2
(re-)starting Error Timer
This is a test.
Sent by timer
but instead it says this:
write 2
(re-)starting Error Timer
This is a test.write 2
(re-)starting Error Timer
This is a test.
Sent by timer
So, if anyone has any ideas about how to get the repetition out of my output, I would appreciate it.
It seems to me that System.out is writing twice, because "write 2" is appearing twice (in the second write override). But it does not write "This is a test." twice to the java standard output when I don't re-route System.out.
Thank you for any help,
Nathan
On Nov 16, 2004, at 6:19 AM, Sako! wrote:
hello dude,
why dont you ask a concrete question.
do you want to convert double into string?
btw, this is a java qustion no relation to wo.
Sako.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden