예제 #1
0
        public Rfc3164(Facility facility, LogLevelSeverityConfig logLevelSeverityConfig, Rfc3164Config rfc3164Config, EnforcementConfig enforcementConfig) : base(facility, logLevelSeverityConfig, enforcementConfig)
        {
            hostnamePolicySet     = new PlainHostnamePolicySet(enforcementConfig);
            tagPolicySet          = new TagPolicySet(enforcementConfig);
            plainContentPolicySet = new PlainContentPolicySet(enforcementConfig);
            asciiMessagePolicy    = new AsciiMessagePolicy(enforcementConfig);

            hostnameLayout = rfc3164Config.Hostname;
            tagLayout      = rfc3164Config.Tag;
        }
 public LogLevelSeverityMapping(LogLevelSeverityConfig logLevelSeverityConfig)
 {
     logLevelSeverityMapping = new Dictionary <LogLevel, Severity>
     {
         { LogLevel.Fatal, logLevelSeverityConfig.Fatal },
         { LogLevel.Error, logLevelSeverityConfig.Error },
         { LogLevel.Warn, logLevelSeverityConfig.Warn },
         { LogLevel.Info, logLevelSeverityConfig.Info },
         { LogLevel.Debug, logLevelSeverityConfig.Debug },
         { LogLevel.Trace, logLevelSeverityConfig.Trace }
     };
 }
예제 #3
0
        public Rfc3164(Facility facility, LogLevelSeverityConfig logLevelSeverityConfig, Rfc3164Config rfc3164Config, EnforcementConfig enforcementConfig) : base(facility, logLevelSeverityConfig, enforcementConfig)
        {
            hostnamePolicySet  = new PlainHostnamePolicySet(enforcementConfig);
            tagPolicySet       = new TagPolicySet(enforcementConfig);
            contentPolicySet   = new ContentPolicySet(enforcementConfig);
            asciiMessagePolicy = new AsciiMessagePolicy(enforcementConfig);

            outputPri      = rfc3164Config.OutputPri;
            outputHeader   = rfc3164Config.OutputHeader;
            outputSpace    = rfc3164Config.OutputSpaceBeforeMsg;
            hostnameLayout = rfc3164Config.Hostname;
            tagLayout      = rfc3164Config.Tag;
        }
예제 #4
0
 public Rfc5424(Facility facility, LogLevelSeverityConfig logLevelSeverityConfig, Rfc5424Config rfc5424Config, EnforcementConfig enforcementConfig) : base(facility, logLevelSeverityConfig, enforcementConfig)
 {
     version           = rfc5424Config.Version;
     hostnameLayout    = rfc5424Config.Hostname;
     appNameLayout     = rfc5424Config.AppName;
     procIdLayout      = rfc5424Config.ProcId;
     msgIdLayout       = rfc5424Config.MsgId;
     structuredData    = new StructuredData(rfc5424Config.StructuredData, enforcementConfig);
     preamble          = rfc5424Config.DisableBom ? new byte[0] : Encoding.UTF8.GetPreamble();
     hostnamePolicySet = new FqdnHostnamePolicySet(enforcementConfig, rfc5424Config.DefaultHostname);
     appNamePolicySet  = new AppNamePolicySet(enforcementConfig, rfc5424Config.DefaultAppName);
     procIdPolicySet   = new ProcIdPolicySet(enforcementConfig);
     msgIdPolicySet    = new MsgIdPolicySet(enforcementConfig);
     utf8MessagePolicy = new Utf8MessagePolicy(enforcementConfig);
 }
예제 #5
0
 protected MessageBuilder(Facility facility, LogLevelSeverityConfig logLevelSeverityConfig, EnforcementConfig enforcementConfig)
 {
     this.facility           = facility;
     logLevelSeverityMapping = new LogLevelSeverityMapping(logLevelSeverityConfig);
     splitOnNewLinePolicy    = new SplitOnNewLinePolicy(enforcementConfig);
 }