ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General Discussion » Debugging thru org.apache.commons.logging package

Post new topic  Reply to topic
 Debugging thru org.apache.commons.logging package « View previous topic :: View next topic » 
Author Message
chanchal
PostPosted: Thu Apr 15, 2004 8:34 am    Post subject: Debugging thru org.apache.commons.logging package Reply with quote

Apprentice

Joined: 30 Jan 2004
Posts: 38

Hey, I am using org.apache.commons.logging package for debugging.By default,it displays all messages on console but I want to put all messages in a file and then view that file as i am using web application so i cannot see messages being displayed on console.Can anybody tell me what to do in order to view it thru a file or how to configure??
Back to top
View user's profile Send private message
helpwithmq
PostPosted: Thu Apr 15, 2004 11:10 pm    Post subject: logging package Reply with quote

Newbie

Joined: 11 Apr 2004
Posts: 4

I have no clue how you are using this package or how it works, but let me try figuring out what you are trying to do.
1. the package you are using generates output and prints it to the terminal
2. you want to divert the o/p to a file
3. and/or display this o/p using a web app.

for [2] you could divert the output to a file. on unix/windows you would do
$java <yourapplicationname> > outputfile &
and then you can have control of the terminal
where <yourapplicationname> is the name of the java app you are running and
outputfile is the file to which you are diverting the log data.
to read the contents of the file as it is updated, on unix you would do
$tail -f outputfile
or
$more outputfile
if you want to read from the top, one page at a time.

[3] if instead you want to use a webapp to call this package and print out to the browser, you are better off displaying the first-n or last-n entries in the log file you generated earlier.
Back to top
View user's profile Send private message
gunter
PostPosted: Fri Apr 16, 2004 3:23 am    Post subject: Reply with quote

Partisan

Joined: 21 Jan 2004
Posts: 307
Location: Germany, Frankfurt

If you on UNIX, you should use:

java .... 1> log.txt 2>&1

because it is possible that you also need the output from stderr.

A other way is to use tee.

java .... | tee log.txt
_________________
Gunter Jeschawitz
IBM Certified System Administrator - Websphere MQ, 5.3
Back to top
View user's profile Send private message
RogerLacroix
PostPosted: Fri Apr 16, 2004 6:49 am    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3264
Location: London, ON Canada

Yuk!!!!!!!!!!!

Lets work in the 21st century, use Log4J with your Java applications. At my current client, we have defined the Log4J layout pattern to be the same no matter where the application runs. (i.e. WebLogic, stand-alone, etc..)

The beauty of Log4J is that you can direct the output to go to multiple places (i.e. console, file, etc...). The level of messages that you want to see (i.e. debug, info, etc...). And automatic log clean (if you want). All configured within the log4j.properties file. You don't rebuild your application to change a configuration parameter, you just update log4j.properties file.

It has many, many more features than I have listed.

Regards,
Roger Lacroix
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General Discussion » Debugging thru org.apache.commons.logging package
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.