internal static void SetTextualSubscriptionIdentity(LogIdentity log, string textualIdentity) { try { Logger logger = GetLogger(log); if (logger != null) { logger.SetTextualSubscriptionIdentity(new System.Deployment.Application.DefinitionIdentity(textualIdentity)); } } catch (COMException) { } catch (SEHException) { } }
internal static void AddErrorInformation(LogIdentity log, string message, Exception exception, DateTime time) { Logger logger = GetLogger(log); if (logger != null) { lock (logger) { logger.Errors.AddError(message, exception, time); } } }
internal static void SetDeploymentManifest(LogIdentity log, AssemblyManifest deploymentManifest) { Logger logger = GetLogger(log); if (logger != null) { lock (logger) { if (deploymentManifest.Identity != null) { logger.Identities.DeploymentIdentity = deploymentManifest.Identity; } logger.Summary.DeploymentManifest = deploymentManifest; } } }
internal static void SetSubscriptionUrl(LogIdentity log, Uri subscriptionUri) { Logger logger = GetLogger(log); if (logger != null) { logger.SetSubscriptionUri(subscriptionUri); } }
internal static void AddErrorInformation(LogIdentity log, string message, Exception exception) { AddErrorInformation(log, message, exception, DateTime.Now); }
internal static void SetApplicationUrl(LogIdentity log, Uri applicationUri) { Logger logger = GetLogger(log); if (logger != null) { lock (logger) { logger.Sources.ApplicationUri = applicationUri; } } }
protected static void RemoveLogger(LogIdentity logIdentity) { lock (_logAccessLock) { if (_loggerCollection.Contains(logIdentity.ToString())) { _loggerCollection.Remove(logIdentity.ToString()); } } }
internal static void SetApplicationManifest(LogIdentity log, AssemblyManifest applicationManifest) { Logger logger = GetLogger(log); if (logger != null) { lock (logger) { if (applicationManifest.Identity != null) { logger.Identities.ApplicationIdentity = applicationManifest.Identity; } logger.Summary.ApplicationManifest = applicationManifest; } } }
internal static string GetLogFilePath(LogIdentity log) { Logger logger = GetLogger(log); if (logger != null) { return GetLogFilePath(logger); } return null; }
protected static Logger GetLogger(LogIdentity logIdentity) { Logger logger = null; lock (_logAccessLock) { if (_loggerCollection.Contains(logIdentity.ToString())) { logger = (Logger) _loggerCollection[logIdentity.ToString()]; } } return logger; }
internal static bool FlushLog(LogIdentity log) { Logger logger = GetLogger(log); if (logger != null) { lock (logger) { return logger.FlushLogs(); } } return false; }
internal static void EndLogging(LogIdentity logIdentity) { try { Logger logger = GetLogger(logIdentity); if (logger != null) { lock (logger) { logger.EndLogOperation(); } } RemoveLogger(logIdentity); } catch (Exception exception) { if (ExceptionUtility.IsHardException(exception)) { throw; } } }
internal static void AddMethodCall(LogIdentity log, string message, DateTime time) { if (_detailedLoggingEnabled) { Logger logger = GetLogger(log); if (logger != null) { lock (logger) { logger.ExecutionFlow.AddMethodCall(message, time); } } } }
internal static void AddMethodCall(LogIdentity log, string message) { AddMethodCall(log, message, DateTime.Now); }
internal static void AddInternalState(LogIdentity log, string message) { AddInternalState(log, message, DateTime.Now); }