Update: Support extended logging arguments

This commit is contained in:
Gary Sharp
2013-05-15 16:19:04 +10:00
parent 0914a85be6
commit 7389d7521f
13 changed files with 44 additions and 27 deletions
+2 -2
View File
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.0513.1342")]
[assembly: AssemblyFileVersion("1.2.0513.1342")]
[assembly: AssemblyVersion("1.2.0513.1423")]
[assembly: AssemblyFileVersion("1.2.0513.1423")]
+2 -2
View File
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.0513.1342")]
[assembly: AssemblyFileVersion("1.2.0513.1342")]
[assembly: AssemblyVersion("1.2.0513.1423")]
[assembly: AssemblyFileVersion("1.2.0513.1423")]
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.0513.1342")]
[assembly: AssemblyFileVersion("1.2.0513.1342")]
[assembly: AssemblyVersion("1.2.0513.1423")]
[assembly: AssemblyFileVersion("1.2.0513.1423")]
+2 -2
View File
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.0513.1342")]
[assembly: AssemblyFileVersion("1.2.0513.1342")]
[assembly: AssemblyVersion("1.2.0514.1205")]
[assembly: AssemblyFileVersion("1.2.0514.1205")]
+2 -2
View File
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.0513.1342")]
[assembly: AssemblyFileVersion("1.2.0513.1342")]
[assembly: AssemblyVersion("1.2.0514.1205")]
[assembly: AssemblyFileVersion("1.2.0514.1205")]
+2 -1
View File
@@ -91,6 +91,7 @@
<Compile Include="Logging\SystemLog.cs" />
<Compile Include="Logging\Targets\LogLiveContext.cs" />
<Compile Include="Logging\Targets\LogPersistContext.cs" />
<Compile Include="Logging\Targets\LogPersistContextInitializer.cs" />
<Compile Include="Logging\Utilities.cs" />
<Compile Include="Plugins\CommunityInterop\PluginLibraryUpdateTask.cs" />
<Compile Include="Plugins\Features\UIExtension\Results\LiteralResult.cs" />
@@ -152,7 +153,7 @@
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<ProjectExtensions>
<VisualStudio>
<UserProperties BuildVersion_UseGlobalSettings="False" BuildVersion_DetectChanges="False" BuildVersion_BuildAction="Both" BuildVersion_StartDate="2011/7/1" BuildVersion_BuildVersioningStyle="None.DeltaBaseYear.MonthAndDayStamp.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_UpdateFileVersion="True" />
<UserProperties BuildVersion_UpdateFileVersion="True" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.DeltaBaseYear.MonthAndDayStamp.TimeStamp" BuildVersion_StartDate="2011/7/1" BuildVersion_BuildAction="Both" BuildVersion_DetectChanges="False" BuildVersion_UseGlobalSettings="False" />
</VisualStudio>
</ProjectExtensions>
<PropertyGroup>
@@ -18,6 +18,7 @@ namespace Disco.Services.Logging.Models
public int EventTypeId { get; set; }
[Required]
public DateTime Timestamp { get; set; }
[Column(TypeName="ntext"), MaxLength]
public string Arguments { get; set; }
}
}
@@ -27,12 +27,7 @@ namespace Disco.Services.Logging.Models
object[] Arguments = null;
if (jsonArguments != null)
{
//var alArguments = fastJSON.JSON.Instance.Parse(jsonArguments) as ArrayList; // Old fastJSON Implementation
Arguments = JsonConvert.DeserializeObject<object[]>(jsonArguments);
//if (alArguments != null)
//{
// Arguments = alArguments.ToArray();
//}
}
return Create(logModule, eventType, Timestamp, Arguments);
}
@@ -11,13 +11,13 @@ namespace Disco.Services.Logging.Targets
{
public LogPersistContext(string ConnectionString) : base(ConnectionString) { }
static LogPersistContext()
{
Database.SetInitializer<LogPersistContext>(new LogPersistContextInitializer());
}
public DbSet<Models.LogModule> Modules { get; set; }
public DbSet<Models.LogEventType> EventTypes { get; set; }
public DbSet<Models.LogEvent> Events { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
//modelBuilder.Conventions.Remove<IncludeMetadataConvention>();
}
}
}
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Disco.Services.Logging.Targets
{
public class LogPersistContextInitializer : IDatabaseInitializer<LogPersistContext>
{
public void InitializeDatabase(LogPersistContext context)
{
if (!context.Database.Exists())
{
context.Database.Create();
}
}
}
}
+2 -2
View File
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.0513.1342")]
[assembly: AssemblyFileVersion("1.2.0513.1342")]
[assembly: AssemblyVersion("1.2.0514.1205")]
[assembly: AssemblyFileVersion("1.2.0514.1205")]
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.0513.1342")]
[assembly: AssemblyFileVersion("1.2.0513.1342")]
[assembly: AssemblyVersion("1.2.0513.1423")]
[assembly: AssemblyFileVersion("1.2.0513.1423")]
+2 -2
View File
@@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.2.0513.1342")]
[assembly: AssemblyFileVersion("1.2.0513.1342")]
[assembly: AssemblyVersion("1.2.0513.1423")]
[assembly: AssemblyFileVersion("1.2.0513.1423")]