meydrew / otroslogviewer

Automatically exported from code.google.com/p/otroslogviewer
0 stars 0 forks source link

Files from rolling file appenders are merged #57

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
"If I open multiple files at the same time, the ones originating from the same 
(rolling file) appender are merged."

Details:

- From the same appender are those files, that have a common prefix and a 
suffix consisting of a dot and arbitrary numbers. The single file with only the 
prefix is the most recent one. Examples: errors.log, errors.log.1, errors.log.2

- Merging could be done either on file level or on entry level. The former is 
possible using the number from the suffix or the file modification date. 
Sorting by entry date requires necissarily that a timestamp exists for each 
entry and can be recognized. I'd go for sorting by suffix. Sorting the entries 
should not be done at this point: That would be a feature independent from this 
issue.

Original issue reported on code.google.com by murat.kn...@googlemail.com on 12 May 2011 at 9:20

GoogleCodeExporter commented 9 years ago
Design Proposal, using the refactored import code on my branch:

I would like to 
a) make this feature configurable, so it can be turned on/off when importing 
selected files
b) have the fact, that the log table is the result of merging several files, 
reflected in the tab. (in this case, I would set the title to "errors.log*" 
instead of just "errors.log")

Therefore, I'd have to extend the class
pl.otros.logview.gui.actions.read.LogFileInNewTabOpener
and consequently
pl.otros.logview.io.LoadingInfo
because it now needs multiple streams.

Do you concur, or do you have an easier approach in mind?

Original comment by murat.kn...@googlemail.com on 24 May 2011 at 7:55

GoogleCodeExporter commented 9 years ago
From Krzysztof:

My proposition is to use 
http://download.oracle.com/javase/1.4.2/docs/api/java/io/SequenceInputStream.htm
l

    Detect that in zip are files from rolling file appender
    Sort these files
    Create SequenceInputStream for all list of files

You can create method in pl.otros.logview.io.Utils:
 public static LoadingInfo openFileObject(FileObject[] fileObject) throws Exception {}
I assume that tailing mode will not be possible.

Worth of consideration is create own implementation of FileObject/FIleContent 
that handle multiple entries, but it will be more complicated in my opinion.

Original comment by murat.kn...@googlemail.com on 25 May 2011 at 7:24

GoogleCodeExporter commented 9 years ago
What about automatically merging in all other files from the given root file? 
I.e. when I import, by whatever way, the file "error.log", OLV might search for 
basically "error.log.[0-9]*" and then import these, too.

What do you think of changing the tab label?

Original comment by murat.kn...@googlemail.com on 25 May 2011 at 7:34

GoogleCodeExporter commented 9 years ago
I think that better option is to load only chosen files. If OLV loads 
automagicly all error.log.[0-9] files, can easily goes to memory problems. 
Let's assume user want to open log myapp.log. But in this directory are files 
myapp.log[1-50] and every myapp.log.* is 100MB.

Original comment by otros.sy...@gmail.com on 3 Jun 2011 at 1:11

GoogleCodeExporter commented 9 years ago
Hi, you're right, following the principle of least surprise. Hopefully, I'll 
soon find the time to look at your code. Sorry it does take time ...

Original comment by murat.kn...@googlemail.com on 7 Jun 2011 at 7:17

GoogleCodeExporter commented 9 years ago
Hi, this feature would be very useful for me, too!

Original comment by ral...@googlemail.com on 16 Jan 2012 at 11:36