Bug 30888 - Chainsaw mixes files in same panel
Chainsaw mixes files in same panel
Status: NEEDINFO
Product: Log4j
Classification: Unclassified
Component: chainsaw
unspecified
PC Windows XP
: P3 major
: ---
Assigned To: log4j-dev
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2004-08-27 11:51 UTC by Rob Oxspring
Modified: 2010-03-28 04:27 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rob Oxspring 2004-08-27 11:51:17 UTC
If two files with the same name are opened (from different directories) then the
events of the second are added to the first instead of using a new tab.  It gets
particularly grim if the panel has been 'hidden' between loading the first and
second file because the second one appears not to load at all.  This is totally
unintuitive IMHO and certainly leads to confusion in my team.
Comment 1 Paul Smith 2004-08-29 21:44:23 UTC
The tab events go to is totally dependant on the value of the application-wide 
property "Tab Identifier".

What is yours set to?  Try using:

PROP.hostname - PROP.application

as the tab identifier and see if that helps.  This should create a new tab for 
each file.  I'm curious to know what your property value is set to.
Comment 2 Rob Oxspring 2004-09-01 15:09:47 UTC
The tab is set to the default "PROP.hostname - PROP.application" but I don't see
what this has to do with anything - where would hostname and application come
from  in the files anyway?

It looks like it's using file.getName() to name the tabs, which then get mixed
because files in different directories can have the same name.
Comment 3 Scott Deboy 2004-09-01 15:26:39 UTC
When loading files into Chainsaw, the paths weren't included in the tab identifier because it had the potential of creating tabs with really long names (this is also because I didn't consider the fact that folks would be loading a file with the same name but from different locations).

I agree this should be changed, probably providing the complete file path, in case folks want to load have logs from separate machines with the same file name and the same path.

As Paul mentioned, events are routed to tabs based on attributes of the event.  As files are loaded, 'hostname' and 'application' properties are added to the event to facilitate this routing to a unique tab.  Examine the detail pane for a selected event. the 'Properties' line includes 'hostname' and 'application' entries, and that's how events are routed.
Comment 4 Paul Smith 2004-09-02 00:39:51 UTC
There's more to this.  If the XML log file contains events that aleady have 
property values for the 'application' and 'hostname' keys, then they are NOT 
overriden with the name of the file.  

Not sure what we should do here, because it's probably bad practice to 'clobber' 
original property values, but I can see the use-case where you want each file 
loaded into it's own tab.
Comment 5 Thorbjørn Ravn Andersen 2008-07-01 15:25:15 UTC
Is it correct that the tab label is the one determining where event should go, even when loaded from different files?  

What would be the appropriate way to deal with this issue now that some time has passed and other parts of the code has developed too?
Comment 6 Scott Deboy 2008-07-01 16:42:28 UTC
Fields on the event (along with the tab identifier specified in the application-wide settings screen) determine which tab events are routed to.  

If a file is loaded (via file/load or through the LogFilePatternReceiver), two properties are added to each of the file's events.  If the default tab identifier is in use, these additional properties will cause the file's events to route to its own tab.

There is also a mechanism by which events can be routed to multiple tabs: via the 'create custom expression logpanel' menu (essentially creates a 'view' of events on other tabs in a new tab).

Not sure if this is what you were asking, but I thought I'd try to explain how the routing works.
Comment 7 Scott Deboy 2010-03-28 04:27:46 UTC
Is this still an issue?