By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,781 Members | 1,364 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,781 IT Pros & Developers. It's quick & easy.

System.out.println("String") Where is the output?

P: n/a
This is from an application and not an Applet.

I believe it goes to stdout but when I do a test and write an abitrary
string and then do a search of the hard disk for the string, I can't find
it. So, I suspect one has to create the file manually before using it.

But I'll be damned if I can remember where.

Thanks to anyone who'll take a few minutes to let me know.
Jul 17 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
> I believe it goes to stdout but when I do a test and write an abitrary
string and then do a search of the hard disk for the string, I can't find
it. So, I suspect one has to create the file manually before using it.


Yes, it goes to stdout. How are you executing this line of code? If
you execute from the command line in a terminal window, you should see
the string written to the terminal screen (unless you've redirected
stdout somehow).

--

Mel Roman
me*@melroman.net
Jul 17 '05 #2

P: n/a

"Mel Roman" <me*@melroman.net> wrote in message
news:1X*******************@news04.bloor.is.net.cab le.rogers.com...
I believe it goes to stdout but when I do a test and write an abitrary
string and then do a search of the hard disk for the string, I can't find it. So, I suspect one has to create the file manually before using it.


Yes, it goes to stdout. How are you executing this line of code? If
you execute from the command line in a terminal window, you should see
the string written to the terminal screen (unless you've redirected
stdout somehow).

--

Mel Roman
me*@melroman.net


It's being executed from a servlet, within a doPost method.

For those not familar with servlets, one enters a URL in a browser that
points to a small java program containing a (in this case doPost) method to
create an HTML page. The HTTP server (Apache) fowards the HTTP request to
the servlet container (Tomcat) which executes the java code that returns the
generated HTML page.
Jul 17 '05 #3

P: n/a
In article <EG********************@magma.ca>, Ron Brennan wrote:
It's being executed from a servlet, within a doPost method.


Hmmm... Sorry, I don't have enough experience with servlets to help any
further. Can anyone else here help out?

--

Mel Roman
me*@melroman.net
Jul 17 '05 #4

P: n/a

"dfdfd" <df**@aol.com> wrote in message
news:%SAUa.5142$5b7.2242@lakeread01...
The location for "System.out" depends on your servlet engine.
"Mel Roman" <me*@melroman.net> wrote in message
news:gF*******************@news01.bloor.is.net.cab le.rogers.com...
In article <EG********************@magma.ca>, Ron Brennan wrote:
It's being executed from a servlet, within a doPost method.


Hmmm... Sorry, I don't have enough experience with servlets to help any
further. Can anyone else here help out?

--

Mel Roman
me*@melroman.net

The servlet engine is Tomcat version 4.1.24, dfdfd.

The stdout file doesn't seem to exist yet anywhere, presumably because it
has to be manually created.
Jul 17 '05 #5

P: n/a
Originally I thought there'd be someone with a quick answer - I didn't mean
to take up anyone else's time doing research.

Tomcat is being started from Apache, so the command line idea won't work.
I'll just have to dig more through the Tomcat docs. I'll post here when I
find it. Thanks.
"dfdfd" <df**@aol.com> wrote in message
news:VAFUa.5252$5b7.951@lakeread01...

"Ron Brennan" <rb******@magma.ca> wrote in message
news:7M********************@magma.ca...

"dfdfd" <df**@aol.com> wrote in message
news:%SAUa.5142$5b7.2242@lakeread01...
The location for "System.out" depends on your servlet engine.
"Mel Roman" <me*@melroman.net> wrote in message
news:gF*******************@news01.bloor.is.net.cab le.rogers.com...
> In article <EG********************@magma.ca>, Ron Brennan wrote:
>
> > It's being executed from a servlet, within a doPost method.
>
> Hmmm... Sorry, I don't have enough experience with servlets to help any > further. Can anyone else here help out?
>
> --
>
> Mel Roman
> me*@melroman.net

The servlet engine is Tomcat version 4.1.24, dfdfd.

The stdout file doesn't seem to exist yet anywhere, presumably because it has to be manually created.


It looks like you need to start Tomcat with a command like this:

$JAVACMD $TOMCAT_OPTS -Dtomcat.home=${TOMCAT_HOME} $MAIN start $@
${TOMCAT_HOME}/logs/stdout.log 2>&1 &


I just saw that from a brief web search. there should be some docs
available for your distribution that explains where stdout goes
by default.

Jul 17 '05 #6

P: n/a
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ron Brennan wrote:
Originally I thought there'd be someone with a quick answer - I
didn't mean to take up anyone else's time doing research.

Tomcat is being started from Apache, so the command line idea won't
work. I'll just have to dig more through the Tomcat docs. I'll post
here when I find it. Thanks.


Hi,
I played with Tomcat a bit under Windows one time and, in all cases, I
started Tomcat with a console window. System.out.println() sent the
string to this console. If there's no console, and the string isn't
getting sent to a file, I suspect it's probably being blackholed. If
you really need System.out, you can try redirecting it to a file from
within your servlet itself, using System.setOut(), although I'm not
sure if the servlet security manager allows that or not. Otherwise,
try creating your own stream to a file and call it something like
"out". Then just use it instead of System.out.

- --
Chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE/I83wwxczzJRavJYRAp1bAKC4+N6GvRBQX/vloBd1UnKlL1iT6QCgoaZZ
kz4K5PhbFGKFfG0K+PGGTrg=
=mzkM
-----END PGP SIGNATURE-----
Jul 17 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.