Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 179860 - Optionally send trace output to file rather than console
Summary: Optionally send trace output to file rather than console
Status: RESOLVED DUPLICATE of bug 173962
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Framework (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: equinox.framework-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-28 17:51 EDT by Walter Harley CLA
Modified: 2007-04-05 11:38 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Walter Harley CLA 2007-03-28 17:51:30 EDT
The -debug flag, combined with .options files, supports troubleshooting of problems in the field.  However, it is difficult for users to send the trace output to a file, instead of having it scroll to the console, especially if the user is invoking Eclipse via a shortcut to a branded .exe instead of calling eclipse.exe at the command line.

It would be helpful if there were a command-line option, also supported in the launcher .ini file, to send debug output to a file.  E.g., the .ini file would end up with something like:

 -debug c:/eclipse/debug.options
 -debugout c:/temp/traceoutput.txt

Sorry if I've assigned this to the wrong component.
Comment 1 DJ Houghton CLA 2007-03-30 09:34:00 EDT
This would require new API to log the information. Currently we have a DebugOptions interface which allows bundles to query whether or not we are in debug mode, but all bundles log their own debug information wherever they like.
Comment 2 Walter Harley CLA 2007-03-30 12:12:17 EDT
I think that most components probably use the ILog interface obtained through Plugin.getLog().  It is okay to just catch that one; there is of course no way to intercept all possible logging mechanisms that a component might invent.
Comment 3 DJ Houghton CLA 2007-03-30 13:08:22 EDT
Just to make sure we aren't mixing use cases, I'll explain the current situation.

Currently you can call Platform#getLog (or acquire the log service) and log events there.

You can also check if you are in debug mode and if so, then do whatever you want. I would wager that currently most people log these events to the console.

So you're suggesting that we add API to the log so you can put debug information there? I think this might not be the best idea since the log file has a specific format and multiple teams rely on this and have readers, etc. 

If we are to make changes in this area, I would suggest somewhere related to DebugOptions.
Comment 4 Walter Harley CLA 2007-03-30 14:39:38 EDT
Oops, sorry, wasn't thinking clearly.  Right, tracing does NOT usually use Log.

But I expect tracing *does* usually use System.out and/or System.err.  Redirecting one or both of those would be very handy.  (It's hard to do this in the normal manner from the command line, because the launcher gets in the way.)
Comment 5 Thomas Watson CLA 2007-04-05 09:44:26 EDT
Would fixing bug 173962 solve you issue?  Then you could do something like:

eclipse.exe 1>trace.out 2>&1
Comment 6 Walter Harley CLA 2007-04-05 11:38:33 EDT
Yes, that would be perfect.

*** This bug has been marked as a duplicate of bug 173962 ***