Exemple #1
0
        private ILogger CreateGlobalLoggerForService(string instanceName)
        {
            Constraint.MustNotBeNull(Configuration, "Configuration");

            var logFilePath = Configuration.GetStringValue(GlobalSettings.Keys.LogFilePath);

            // ReSharper disable once AssignNullToNotNullAttribute
            logFilePath = string.Format(logFilePath, string.Format(".{0}", instanceName));
            logFilePath = PathHelp.RootPathIfRelative(logFilePath, AppDomain.CurrentDomain.BaseDirectory);
            return(Log4NetLogger.GetLogger(ExeAppSettings.FilePath,
                                           Appenders.Trace(),
                                           Appenders.ColouredConsole(),
                                           Appenders.EventLog(EventLogSource),
                                           Appenders.RollingFile(logFilePath, true)));
        }