title: Custom database target properties will not save
body: <p>So my .NET solution actually has 2 different projects, one for Data Access Layer and another for the main project.. I am wondering if that is why my values aren't being carried over between projects or something. I have added the NLog configuration to the Global.asax.cs file in my main project:</p>
  
  <pre><code>var config = new LoggingConfiguration();
  // Add another NLog Target (ChangeTracking)
  var changeTrackingDbTarget = new DatabaseTarget()
  {
      Name = "ChangeTracking",
      ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["NLogConnection"].ConnectionString,
      CommandText = "INSERT INTO Common.ChangeTracking ( ApplicationID,  UserName,  Name,  EntityName,  PropertyName,  PrimaryKeyValue,  OldValue,  NewValue, DateChanged) " +
                    "VALUES (@ApplicationID, @UserName, @Name, @EntityName, @PropertyName, @PrimaryKeyValue, @OldValue, @NewValue, @DateChanged);"
  };
  
  changeTrackingDbTarget.Parameters.Add(new DatabaseParameterInfo() { Name = "@ApplicationID", Layout = "${appsetting:name=AppID:default=null}" });
  changeTrackingDbTarget.Parameters.Add(new DatabaseParameterInfo() { Name = "@UserName", Layout = "${identity:authType=false:isAuthenticated=false}" });
  changeTrackingDbTarget.Parameters.Add(new DatabaseParameterInfo() { Name = "@Name", Layout = "${gdc:item=name}" });
  changeTrackingDbTarget.Parameters.Add(new DatabaseParameterInfo() { Name = "@EntityName", Layout = "${gdc:item=entityname}" });
  changeTrackingDbTarget.Parameters.Add(new DatabaseParameterInfo() { Name = "@PropertyName", Layout = "${gdc:item=propname}" });
  changeTrackingDbTarget.Parameters.Add(new DatabaseParameterInfo() { Name = "@PrimaryKeyValue", Layout = "${gdc:item=primarykey}" });
  changeTrackingDbTarget.Parameters.Add(new DatabaseParameterInfo() { Name = "@OldValue", Layout = "${event-properties:item=oldvalue}" });
  changeTrackingDbTarget.Parameters.Add(new DatabaseParameterInfo() { Name = "@NewValue", Layout = "${event-properties:item=newvalue}" });
  changeTrackingDbTarget.Parameters.Add(new DatabaseParameterInfo() { Name = "@DateChanged", Layout = "${date}" });
  
  config.LoggingRules.Add(new LoggingRule("*", LogLevel.Info, changeTrackingDbTarget));
  
  //LogManager.Configuration.AddTarget("ExceptionTracking", dbTarget);
  LogManager.Configuration = config;
  LogManager.Configuration.AddTarget("ChangeTracking", changeTrackingDbTarget);
  </code></pre>
  
  <p>As you can see, I have tried using event properties, and gdc, but neither actually get the parameters I am trying to send. However, the ApplicationID, Username, and DateChanged get set(and saved to the Common.ChangeTracking table just fine) just fine because they are not custom properties.</p>
  
  <p>The class containing the code that actually tries to log the changes on save is in the root of my Data Access Layer project (Neither GDC or EventInfo seems to work):</p>
  
  <pre><code>private static Logger _logger = LogManager.GetLogger("ChangeTracking");
  //private static Logger _logger = LogManager.GetCurrentClassLogger();
  
  LogEventInfo changeEvent = new LogEventInfo(LogLevel.Info, "ChangeTracking", "A change event has been fired");
  GlobalDiagnosticsContext.Set("Name", "Jake");
  changeEvent.Properties["EntityName"] = "test";
  changeEvent.Properties["PropertyName"] = "test property name";
  changeEvent.Properties["PrimaryKeyValue"] = 123;
  changeEvent.Properties["OldValue"] = "test";
  changeEvent.Properties["NewValue"] = "test";
  _logger.Log(changeEvent);
  </code></pre>