Log4View v2 - Support for custom file receivers

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Log4View v2 - Support for custom file receivers

Olaf Kober
Hello!

We currently use Log4View in our company to receive log messages via custom TCP channel. We wrote our own receiver and this works perfectly well.

But we have also log files in a custom binary format, which cannot be opened by Log4View by default. We'd like to use Log4View as viewer for those binary log files too, but how can we extend Log4View to recognized our file format/file extension?

Is it currently possible to write an extension (receiver?) that extends the file formats supported by Log4View? Such an extension could also support loading log messages from a file supplied via command line.

Do you have plans to support that / would that be a good idea?
Reply | Threaded
Open this post in threaded view
|

Re: Log4View v2 - Support for custom file receivers

Ulrich
Administrator
Hello Olaf,

it is possible to write extensions to Log4View.
In the folder "C:\Program Files (x86)\Log4View V2" you find two sample projects for extensions, "SampleDashboard" and "SampleReceiver".
SampleReceiver is a simple receiver extension which you can use as a blueprint for your own custom receiver.
SampleDashbord shows how to create a custom visualisation plugin.

Please ask, if you need further help.

Ulrich
Reply | Threaded
Open this post in threaded view
|

Re: Log4View v2 - Support for custom file receivers

Olaf Kober (Anton Paar GmbH)
Hello Ulrich!

Thanks for your reply.

As I mentioned in my initial post, we already developed a custom extension for receiving log messages via network similar to your "SampleReceiver" example. That works well.


Now, I'm looking for a convenient way to extend Log4View to open/read our proprietary log files. A receiver extension doesn't fit well, because I don't want to go to the extension config dialog all the time just for choosing the file to open. That's a bit inconvenient for daily usage.

I hoped to have the possibility to write a file-based receiver extension that would handle a set of file formats/extensions (i.e. "*.aplx"). Then when opening Log4View and supplying a file path via command line I would expect Log4View to select the best file-based receiver extension for reading the log file.

AFAIK, Log4View supports only a few hard-coded file formats, all of them text-based. I want to register my own file format handler (file-based receiver) for my own custom file format.

I think that would be a great new feature for Log4View. For us it would mean we can throw away our home-grown log file viewer and use Log4View instead.

What do you think about that?


Kind regards,
Olaf
Reply | Threaded
Open this post in threaded view
|

Re: Log4View v2 - Support for custom file receivers

Ulrich
Administrator
This post was updated on .
Hello Olaf,

first of all a Happy New Year to you and your family!

You can link your file extensions with your custom receiver by changing the Log4View config file (Log4View.exe.config). Search for "DefinedExtensionReceivers". Here you find the line
<string>ExampleReceiver,.example</string>

This line is just an example (there is no ExampleReceiver). As you can see, it is just a pair of strings, the name of the receiver, followed by a file extension.
Replace this by your own pair of receiver and appropriate extension and Log4View will use the named receiver for that extension.

Ulrich
Reply | Threaded
Open this post in threaded view
|

Re: Log4View v2 - Support for custom file receivers

Ulrich
Administrator
I have just updated the above post.
Reply | Threaded
Open this post in threaded view
|

Re: Log4View v2 - Support for custom file receivers

Olaf Kober (Anton Paar GmbH)
Hi Ulrich!

Thanks for your response.

That did the trick!

Kind regards,
Olaf