all groups > visual studio .net enterprise tools > july 2007 >
You're in the

visual studio .net enterprise tools

group:

Application Logging Block without config file


Application Logging Block without config file Severin Meyer
7/21/2007 8:56:01 AM
visual studio .net enterprise tools:
I'm searching for a simple logging library and want to give the Enterprise
Library a try.

The problem I'm delaing with at first is to configure this bulding block.
The defaut way is to do this in the config-file. The problem is, that I don't
want to use such a configuration file. The configuration for my application
is stored else where.

My approaoch is to configure the logger solely with code in c#. So I will be
free where and in which format I store my settings.
Unfortunatly I have not found any sample to do this. The only hint I have
found is that it should be possible even without config file.

Perhaps there is someone out there who can direct me to a usable sample.

Regards,

Re: Application Logging Block without config file Severin Meyer
9/1/2007 1:12:01 PM
This meens, that I don't want to use the normal .config files provided by the
..net Framework.

Sometimes my settings data is persisted in the registry, datbase, or else
where.
So I need to get a procedure to set the configuration of the Logger directly
throug the code.

I have found a way to configure an instance of a LogWriter to do what I
want, just throug code. But if I'm Logging via the static "Logger" class,
there is an exception, that nothing was configured.

I think, that the Logger is using a predefined LogWriter, but I was unable
to initialize it.

Hope this clarifys my problem a bit.

Severin

[quoted text, click to view]
Re: Application Logging Block without config file Stevanich
9/1/2007 2:42:10 PM
Severin,

Could you explain what you mean by 'The configuration for my application is
stored elsewhere'?

Thanks,

Steve - dotneticated.com

[quoted text, click to view]

Re: Application Logging Block without config file Severin Meyer
9/2/2007 2:40:00 PM
Hi Steve

I knew about the blog, but it doesn't solve the problem. The schema to save
the configuration is still the same.

But many thanks for your answer, I really appriciate it.

Severin


[quoted text, click to view]
Re: Application Logging Block without config file Stevanich
9/2/2007 2:59:00 PM
Severin,

Tom Hollander explains a couple different methods for storing the Enterprise
Library configuration. You will still need a *.config file in some form
though.

http://blogs.msdn.com/tomholl/archive/2006/04/02/entlib2externalconfig.aspx

Hope this helps,


Steve

[quoted text, click to view]

AddThis Social Bookmark Button