Skip to content

Commit

Permalink
Fix: use RFC 5424 config values instead of hardcoded ones
Browse files Browse the repository at this point in the history
  • Loading branch information
luigiberrettini committed Feb 12, 2017
1 parent b72202d commit cc3d695
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/NLog.Targets.Syslog/MessageCreation/Rfc5424.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ namespace NLog.Targets.Syslog.MessageCreation
{
internal class Rfc5424 : MessageBuilder
{
private const string DefaultVersion = "1";
private const string NilValue = "-";
private const string TimestampFormat = "{0:yyyy-MM-ddTHH:mm:ss.ffffffK}";
private static readonly byte[] SpaceBytes = { 0x20 };

Expand All @@ -30,11 +28,11 @@ internal class Rfc5424 : MessageBuilder

public Rfc5424(Facility facility, Rfc5424Config rfc5424Config, EnforcementConfig enforcementConfig) : base(facility, enforcementConfig)
{
version = DefaultVersion;
version = rfc5424Config.Version;
hostnameLayout = rfc5424Config.Hostname;
appNameLayout = rfc5424Config.AppName;
procIdLayout = NilValue;
msgIdLayout = NilValue;
procIdLayout = rfc5424Config.ProcId;
msgIdLayout = rfc5424Config.MsgId;
structuredData = new StructuredData(rfc5424Config.StructuredData, enforcementConfig);
disableBom = rfc5424Config.DisableBom;
hostnamePolicySet = new FqdnHostnamePolicySet(enforcementConfig, rfc5424Config.DefaultHostname);
Expand Down

0 comments on commit cc3d695

Please sign in to comment.