• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java on iSeries  RSS feed

 
Bartender
Posts: 1801
28
Chrome Eclipse IDE Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have no idea which forum to use for this question, but here goes. I'm venturing into new territory and writing a Java program that will run on the JVM on the iSeries. It's not very complex, it's just going to connect to an Oracle database, fetch some data, and insert it into a table on the iSeries.

My question is about how to do logging. I usually use java.util.logging like so:

But on the iSeries, where is this going to go? Same with system.out.println, where does that go? Should I be doing something completely different? I want to catch any possible exceptions (I detest empty catch blocks), but I want to log them instead of just declaring every possible exception and letting them bubble to who knows where.

Totally out of my comfort zone on this one...

 
Sheriff
Posts: 22846
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm two years retired from doing that now, but let me tax my memory... probably it depends on how you're running the Java program.

If you're using the RUNJVA command then I think there are options to redirect stdout and stderr in there, to somewhere in the IFS. If I remember correctly these options caused the output to be written in EBCDIC which was a PITA when you tried to look at them through a mapped drive. Otherwise if you're running it from that Unix-like command line then you just use > and >> to redirect them.

I never got used to the built-in Java logging because by the time they put that into Java I had already been using log4j for a long time, so I don't know how that works on any system. But if you're used to it then it should work the same on the System i as it does on any other system -- just create yourself some directories in the IFS and direct your logging there.
 
J. Kevin Robbins
Bartender
Posts: 1801
28
Chrome Eclipse IDE Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks! It will be called from RPG using the RUNJVA command, so I'll research that and see how to redirect the output. You got me pointed in the right direction, I appreciate it.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!