|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Debugging thru org.apache.commons.logging package |
« View previous topic :: View next topic » |
Author |
Message
|
chanchal |
Posted: Thu Apr 15, 2004 8:34 am Post subject: Debugging thru org.apache.commons.logging package |
|
|
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 |
|
 |
helpwithmq |
Posted: Thu Apr 15, 2004 11:10 pm Post subject: logging package |
|
|
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 |
|
 |
gunter |
Posted: Fri Apr 16, 2004 3:23 am Post subject: |
|
|
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 |
|
 |
RogerLacroix |
Posted: Fri Apr 16, 2004 6:49 am Post subject: |
|
|
 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 |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|