Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-02-2007, 01:55 AM
Member
 
Join Date: Aug 2007
Posts: 2
vignesh is on a distinguished road
Java Logging
Hi All,
I have a problem using java logging. I have currently set the handler to FileHandler to redirect all my logs to a log file. And in some cases I have to redirect that particular log to the java console. I couldn't able to do that even if I reset the handler to ConsoleHandler.
How do I manage to use two different handlers alternatively when required? That is sometimes I might require to redirect the log to java console and in some cases to a log file.
If anybody knows the solution please reply me.
I appreciate your time.
Thanks,
-- Vignesh.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-02-2007, 04:55 PM
Member
 
Join Date: Aug 2007
Posts: 47
henry_78 is on a distinguished road
Hi,
I think u have to take a look to the System class in java, it provides a way to ridirect streams from and to standard input(System.in) and standard output(System.out).
I think that will help u..Bye.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 08-03-2007, 12:13 AM
Member
 
Join Date: Aug 2007
Posts: 2
vignesh is on a distinguished road
Java Logging
Thanks for ur reply.
Still I have problem. Since I have rebinded stderr to logger as
System.setErr( new PrintStream( stderrLOS, true ) );
and i did the same for stdout too.
So all my stdout and stderr msgs will be redirected to log file.
NOw i have to reset it to normal, ie. I have to send those msgs to java console instead of log file. Do u have any idea about it?
Thank u for ur time.
-- Vignesh.
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 08-03-2007, 10:52 AM
Member
 
Join Date: Aug 2007
Posts: 47
henry_78 is on a distinguished road
Hi,
To reset to norma all u have to do is :
System.setErr(System.err);
System.setOut(System.out);
Bye.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Logging applications ravian New To Java 2 01-02-2008 07:43 PM
what is logging Thirumalt Java Announcements 1 11-26-2007 12:37 PM
X11.Toolkit logging out of control gjsalazar AWT / Swing 0 11-21-2007 12:42 AM
Logging ravian New To Java 3 11-18-2007 11:22 PM
Java Logging vaswin Advanced Java 0 08-06-2007 02:18 PM


All times are GMT +3. The time now is 12:29 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org