Lost Password?


Go Back   CodeCall Programming Forum > Software Development > Java Help

Java Help Java Help forum discussing all Java platforms - J2ME, J2SE and J2EE - as well as relevant standards, APIs and frameworks such as Swing, Servlets, JSPs, Applets, Struts, Spring, Hibernate, ANT, EJB, and other Java-related topics.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-21-2008, 01:31 AM
Victor Victor is offline
Learning Programmer
 
Join Date: May 2007
Posts: 96
Rep Power: 6
Victor is on a distinguished road
Default Logging ?

Is there a way to log System.out and System.err to a text file w/o redirecting, i.e. the console and the file would match?

Thanks in advance
__________________
Pegasus Homepage
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 07-22-2008, 06:42 AM
marwex89's Avatar   
marwex89 marwex89 is offline
Guru
 
Join Date: Jul 2008
Location: Viking-land!
Posts: 3,993
Rep Power: 30
marwex89 is a jewel in the roughmarwex89 is a jewel in the roughmarwex89 is a jewel in the rough
Send a message via AIM to marwex89
Default Re: Logging ?

It might be some trick you can use that I'm not aware about....

I would write my own function for e.g. System.out which use System.out like normal, but also logs the information like you want it.

That's just my way
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 07-22-2008, 03:40 PM
Victor Victor is offline
Learning Programmer
 
Join Date: May 2007
Posts: 96
Rep Power: 6
Victor is on a distinguished road
Default Re: Logging ?

I thought about something like that, but it's a complex program with several classes that use System.out alot. I'd hate to do something time consuming when a simple function could be used. I'm able to log to a file the System.out and System.err, but it redirects the traffic
__________________
Pegasus Homepage
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 07-22-2008, 03:43 PM
marwex89's Avatar   
marwex89 marwex89 is offline
Guru
 
Join Date: Jul 2008
Location: Viking-land!
Posts: 3,993
Rep Power: 30
marwex89 is a jewel in the roughmarwex89 is a jewel in the roughmarwex89 is a jewel in the rough
Send a message via AIM to marwex89
Default Re: Logging ?

I mean a function like:

Declaring func "OutEx" (params)
System.out (params)
[log here] (params)

And then just replace everywhere you use System.Out.

If this doesn't work for you, I'm not sure..... Maybe ask someone else
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 07-22-2008, 03:45 PM
Victor Victor is offline
Learning Programmer
 
Join Date: May 2007
Posts: 96
Rep Power: 6
Victor is on a distinguished road
Default Re: Logging ?

I understood what you were talking about, and if nothing better is suggested I will just have to do that.
__________________
Pegasus Homepage
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #6 (permalink)  
Old 07-22-2008, 04:30 PM
marwex89's Avatar   
marwex89 marwex89 is offline
Guru
 
Join Date: Jul 2008
Location: Viking-land!
Posts: 3,993
Rep Power: 30
marwex89 is a jewel in the roughmarwex89 is a jewel in the roughmarwex89 is a jewel in the rough
Send a message via AIM to marwex89
Default Re: Logging ?

Patience, son, patience
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT -5. The time now is 03:01 AM.

Contest Stats

WingedPanther ........ 2753.6
Xav ........ 2704
Brandon W ........ 1702.32
John ........ 1207.73
marwex89 ........ 1175.24
morefood2001 ........ 966.05
dcs ........ 655.75
Steve.L ........ 475.59
orjan ........ 418.58
Aereshaa ........ 383.54

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 100%


Complete - Celebrate!

Ads