Esempio n. 1
0
 // used by wcf and test (predefined UserContext with its own transformException)
 public AdminkaRoutineHandlerBaseAsync(
     ApplicationSettings applicationSettings,
     IPerformanceCounters performanceCounters,
     IConfigurationContainerFactory configurationFactory,
     Func <Exception, Guid, MemberTag, /* Func<Exception, string>,*/ Exception> routineTransformException,
     Guid correlationToken,
     ITraceDocumentBuilder documentBuilder,
     MemberTag memberTag,
     TUserContext userContext,
     bool hasVerboseLoggingPrivilege,
     string configurationFor,
     Func <TUserContext, string> getAuditStamp,
     object input
     ) : this(
         applicationSettings,
         performanceCounters,
         routineTransformException,
         InjectedManager.ComposeNLogMemberLoggerFactory(documentBuilder),
         InjectedManager.CreateContainerFactory(configurationFactory).CreateContainer(memberTag, configurationFor),
         correlationToken,
         memberTag,
         userContext,
         hasVerboseLoggingPrivilege,
         getAuditStamp,
         input)
 {
 }
Esempio n. 2
0
 public AdminkaRoutineHandlerBaseAsync(
     ApplicationSettings applicationSettings,
     TUserContext userContext,
     Func <TUserContext, string> getAuditStamp,
     object input,
     Guid correlationToken,
     ITraceDocumentBuilder documentBuilder,
     bool hasVerboseLoggingPrivilege,
     string configurationFor,
     MemberTag memberTag
     ) : this( // to final
         applicationSettings,
         getAuditStamp,
         new AdminkaRoutineHandlerFactory <TUserContext>(
             correlationToken,
             InjectedManager.DefaultRoutineTagTransformException,
             InjectedManager.ComposeNLogMemberLoggerFactory(documentBuilder),
             applicationSettings.PerformanceCounters)
         .CreateLoggingHandler(
             memberTag,
             InjectedManager.CreateContainerFactory(
                 applicationSettings.ConfigurationContainerFactory
                 ).CreateContainer(memberTag, configurationFor),
             userContext,
             hasVerboseLoggingPrivilege,
             input)
         )
 {
 }
Esempio n. 3
0
 public AdminkaAnonymousRoutineHandlerAsync(
     ApplicationSettings applicationSettings,
     IPerformanceCounters performanceCounters,
     IConfigurationContainerFactory configurationContainerFactory,
     Func <Exception, Guid, MemberTag, /*Func<Exception, string>,*/ Exception> transformException,
     Guid correlationToken,
     ITraceDocumentBuilder documentBuilder,
     MemberTag memberTag,
     AnonymousUserContext anonymousUserContext,
     object input
     ) : base(
         applicationSettings,
         performanceCounters,
         configurationContainerFactory,
         transformException,
         correlationToken,
         documentBuilder,
         memberTag,
         anonymousUserContext,
         false, //getVerboseLoggingFlag: (userContext) => "VerboseLogging", // (userContext) => (userContext?.User?.HasPrivilege(Privilege.VerboseLogging) ?? false) ? Privilege.VerboseLogging : null
         configurationFor: anonymousUserContext.AuditStamp,
         u => u.AuditStamp,
         input
         )
 {
 }
Esempio n. 4
0
        public NLogLoggingAdapter(
            Guid correlationToken,
            ITraceDocumentBuilder documentBuilder,
            MemberTag memberTag,
            Func <Exception, string> markdownException,
            Func <object, int, bool, string> serializeObject
            )
        {
            this.correlationToken = correlationToken;
            this.documentBuilder  = documentBuilder;
            this.memberTag        = memberTag;
            var loggerName = "Routine:" + memberTag.GetCategory();

            logger = LogManager.GetLogger(loggerName); // ~0.5 ms
            this.serializeObject   = serializeObject;
            this.markdownException = markdownException;
        }
Esempio n. 5
0
 public AdminkaAnonymousRoutineHandler(
     ApplicationSettings applicationSettings,
     string auditStamp,
     object input,
     Guid correlationToken,
     ITraceDocumentBuilder documentBuilder,
     string controllerNamespace,
     string controllerName,
     [CallerMemberName] string member = null
     ) : this(
         applicationSettings,
         new AnonymousUserContext(auditStamp),
         input,
         correlationToken,
         documentBuilder,
         controllerNamespace,
         controllerName,
         member
         )
 {
 }
Esempio n. 6
0
 public AdminkaAnonymousRoutineHandler(
     ApplicationSettings applicationSettings,
     AnonymousUserContext anonymousUserContext,
     object input,
     Guid correlationToken,
     ITraceDocumentBuilder documentBuilder,
     string controllerNamespace,
     string controllerName,
     [CallerMemberName] string member = null
     ) : base(
         applicationSettings,
         anonymousUserContext,
         getAuditStamp: u => u.AuditStamp,
         input,
         correlationToken: correlationToken,
         documentBuilder: documentBuilder,
         hasVerboseLoggingPrivilege: false,
         configurationFor: anonymousUserContext.AuditStamp,
         memberTag: new MemberTag(controllerNamespace, controllerName, member)
         )
 {
 }
Esempio n. 7
0
 public AdminkaInternalUserRoutineHandlerAsync(
     ApplicationSettings applicationSettings,
     UserContext internalUserContext,
     object input,
     Guid correlationToken,
     ITraceDocumentBuilder documentBuilder,
     string controllerNamespace,
     string controllerName,
     [CallerMemberName] string member = null
     ) : base(
         applicationSettings,
         internalUserContext,
         u => u.AuditStamp,
         input,
         correlationToken: correlationToken,
         documentBuilder: documentBuilder,
         hasVerboseLoggingPrivilege: false,
         configurationFor: internalUserContext.User.LoginName,
         memberTag: new MemberTag(controllerNamespace, controllerName, member)
         )
 {
 }
Esempio n. 8
0
 public static Func <Guid, MemberTag, IMemberLogger> ComposeNLogMemberLoggerFactory(ITraceDocumentBuilder documentBuilder)
 {
     return((correlationToken, memberTag) => {
         var nLogLoggingAdapter = new NLogLoggingAdapter(correlationToken, documentBuilder, memberTag, Markdown, SerializeToJson);
         return nLogLoggingAdapter;
     });
 }