Click here to Skip to main content
15,888,113 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,
I created an application that is able to load plugins and displays them.

I now integrated Logging (Enterprise Library) into the mainframe which makes me start thinking how to pass the centralized loggin mechanism of the mainframe to the loaded plugins.

Would it work to implement an Export in the mainframe and a related Import in the plugin?

What catalog should I use for this?

Or is there a better way to deal with this...
I also thought about moving the logging stuff to a seperate class (kind of wrapper for the EntLib logging because of the configuration does not need to be multiplied) and import it in the mainframe as well as in the plugins...

Any help is kindly appreciated,
best regards
Andy
Posted
Comments
wizardzz 19-Jan-11 12:59pm    
I've worked on a plugin/framework project before. Is each plugin writing to it's own log, or are you trying to keep one central log?
hoernchenmeister 20-Jan-11 2:25am    
The idea behind is that every plugin shall write its logging information into the same database.
But if necessary this should be exchangable via the plugin mechanism.

I thought about this tonight and maybe the idea where every plugin just imports a "Logger" would suite best.
I would be able to exchange importing code for the plugins if necessary and put the configuration of the EntLib logging into an extra dll. It would also allow to import multiple loggers (if ever necessary) in a later stage.

Anyway, it is more a theoretical question now... still the other option would be having the mainframe import the loggers via MEF and then inject those into the plugins on load. That would require a change to the contract the plugins are based on (its a pretty early stage so this would be possible).

I really like the idea behind having MEF import whatever I need, but is this the best approach?
What do you think?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900