Skip to content

Commit

Permalink
Allow the use of layout in configuration.
Browse files Browse the repository at this point in the history
The use of targewithlayout allow the use of things like ${aspnet-user-identity} or ${exception}.
  • Loading branch information
ngraziano committed Jan 17, 2012
1 parent 366ec43 commit 256f256
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/NLog.Targets.Syslog/NLog.Targets.Syslog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace NLog.Targets
/// </summary>

[NLog.Targets.Target("Syslog")]
public class Syslog : NLog.Targets.Target
public class Syslog : NLog.Targets.TargetWithLayout
{
/// <summary>
/// Initializes a new instance of the Syslog class
Expand Down Expand Up @@ -264,7 +264,7 @@ protected override void Write(LogEventInfo logEvent)
// Set the current Locale to "en-US" for proper date formatting
Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");

byte[] msg = buildSyslogMessage(Facility, getSyslogSeverity(logEvent.Level), DateTime.Now, Sender, logEvent.FormattedMessage);
byte[] msg = buildSyslogMessage(Facility, getSyslogSeverity(logEvent.Level), DateTime.Now, Sender, Layout.Render(logEvent));
sendMessage(SyslogServer, Port, msg);

// Restore the original culture
Expand Down

0 comments on commit 256f256

Please sign in to comment.