CJP (Certifiable Java Programmer), AMSE (Anti-Microsoft Software Engineer)
Author of Posts in the Saloon
Joined: Mar 06, 2001
sorry , neglected to mention platform and other details. the platform is UNIX (Solaris) and it is for web server. btw, where/how do i do it in NT ?
Joined: Aug 02, 2001
Can't help with Web Server as I don't use it, only App Server. On Solaris, iAS writes System.out.println() to std logs named 'kjs.XXXX', where the XXXX is the port number. On NT, I can't get System.out.println() working, so I write log messages to a file using a Logger class I wrote.
Hi Gerry, On NT you can see all the <i>System.out.println("")</i> messages, here is the procedure to set that. In Services window first stop the iAS application server, then double click on the application server 6.0, it will open another window, there will be a check box under "<b>Log On As:</b>" heading saying "<b>Allow Services to interact with Desktop</b>", just check that and press "Ok" and restart the application server. It will open one <i>dos/cmd</i> windows for each engine process (<i>KAS/KXS/KJS/CXS</i>), and in the KJS window you can see all the <i>System.out.println("")</i> messages (please increase window buffer to see more lines in the window. Hope this will help, for more questions please visit http://softwareforum.sun.com Regards, Sanjeev.
Try our New Web Based Forum at <a href="http://softwareforum.sun.com" target="_blank" rel="nofollow">http://softwareforum.sun.com</a>
Joined: Aug 02, 2001
Ok, I need to amend my last post. I can't get System.out.println() working *resonably*. Having 5 DOS windows open up every boot and being unable to make them go away without shutting down the services is unreasonable. Any app the opens lots of windows creates clutter and make it difficult to figure out where you are and work efficiently. Mind you, I'm working on *2* 19" monitors in high-res mode and already have my taskbar expanded up to two rows of tasks!! I might have stuck with it if it weren't for one thing: after I position all the kXX windows where I want them, if I restart the server they close and then come back and position themselves where they want to, not where I left them last time. Restarting is essential to development because iAS doesn't always load/run the new code. iPlanet really needs an interactive real-time log viewer for the windows platform, one that will show the System.out.println()s, but in the meantime I still recommend using a logging API to catch debug info at a minimum.
i've seen iWS (web server!) swallow anything that you try to printout from a servlet using the very API that you are supposed to use! the log() method on the GenericServlet !
Other time's I've managed to catch System.out.println()'s from iWS.
They are,of course,completely inaccessible in all cases, but if you go to administer the iWS and you click 'Apply' then select "Start and Stop", it takes you to a page where a few things print out on the webpage... amazingly enough, if you have a few System.out.println's in the init method of a servlet that you have set to load-on-startup.. you will see these messages intermixed with iPlanet's startup messages.
But not in any log files!
And by the way, this is all on NT/2000. It doesn't seem to have these problems on Solaris.
Originally posted by j_kokil: On 2000 put Init fn="nt-console-init" stdout=console stderr=console line in magnus.conf and everthing works fine.
It's the same in NT. BTW, the above works for iws 6 but for iws 4.x you need to put the same line in obj.conf file. You can also specify a file name if you don't like the consoles opening up. Here's how... Init fn="nt-console-init" stdout="<filename>" stderr="<filename>" You could also specify the same file name for both streams.
subject: How to log System.out.println in iplanet ?