NLog.Config.LoggingConfiguration.Install C# (CSharp) Method

Install() public method

Installs target-specific objects on current system.
Installation typically runs with administrative permissions.
public Install ( InstallationContext installationContext ) : void
installationContext InstallationContext The installation context.
return void
        public void Install(InstallationContext installationContext)
        {
            if (installationContext == null)
            {
                throw new ArgumentNullException("installationContext");
            }

            this.InitializeAll();
            foreach (IInstallable installable in EnumerableHelpers.OfType<IInstallable>(this.configItems))
            {
                installationContext.Info("Installing '{0}'", installable);

                try
                {
                    installable.Install(installationContext);
                    installationContext.Info("Finished installing '{0}'.", installable);
                }
                catch (Exception exception)
                {
                    if (exception.MustBeRethrown())
                    {
                        throw;
                    }

                    installationContext.Error("'{0}' installation failed: {1}.", installable, exception);
                }
            }
        }