DCSIMG
How to use different config source in entlib logger - Doron Caspin

Doron Caspin

Linux is user friendly - it's just picky about it's friends.

How to use different config source in entlib logger

This post would help developer that want to use entlib with different config file not app.config or web.config

Enjoy

public class LogMgr
    {
        private static IConfigurationSource _configSource;
        private static LogWriter            _logWriter;

        static LogMgr()
        {
            m_configSource = ConfigMgr.FileConfigurationSource;
            LogWriterFactory logWrtFact = new LogWriterFactory(_configSource);
            logWriter = logWrtFact.Create();
            logWriter.Write(logEnt);
        }

    }

Technorati Tags: ,,
פורסם: Nov 29 2007, 09:44 AM by doronc | with 2 comment(s) |
תגים:,

תוכן התגובה

doronc כתב/ה:

Hi,

1. ConfigMgr is a utility class to get configuration files from unc - its just retrun a config file use System.Configuration; to create this object

you do not have to change the entlib

this code is a wrapper class around entlib

Just create a new class with static method to writing the log

enjoy

# December 5, 2007 11:12 AM
שלח תגובה

(שדה חובה)  

(שדה חובה)  

(אופציונלי)

(שדה חובה) 

Please add 4 and 6 and type the answer here:


Enter the numbers above: