Skip to content

Commit b156d05

Browse files
author
Jaben
committedSep 9, 2014
Added new module to allow release Papercut to log debug messages.
1 parent 00f58cc commit b156d05

File tree

7 files changed

+66
-7
lines changed

7 files changed

+66
-7
lines changed
 

‎Papercut.Core/PapercutCoreModule.cs

-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ protected override void Load(ContainerBuilder builder)
128128
{
129129
var appMeta = c.Resolve<IAppMeta>();
130130

131-
//var jsonSink = new RollingFileSink(@"papercut.json", new JsonFormatter(), null, null);
132131
string logFilePath = Path.Combine(
133132
AppDomain.CurrentDomain.BaseDirectory,
134133
string.Format("{0}.log", appMeta.AppName));

‎Papercut.Core/Rules/Implementations/ForwardRule.cs

+18
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,24 @@ namespace Papercut.Core.Rules.Implementations
2020
using System;
2121
using System.ComponentModel;
2222

23+
[Serializable]
24+
public class ConditionalForwardRule : ForwardRule
25+
{
26+
string _regexHeaderMatch;
27+
28+
public string RegexHeaderMatch
29+
{
30+
get { return _regexHeaderMatch; }
31+
set
32+
{
33+
if (value == _regexHeaderMatch)
34+
return;
35+
_regexHeaderMatch = value;
36+
OnPropertyChanged("RegexHeaderMatch");
37+
}
38+
}
39+
}
40+
2341
[Serializable]
2442
public class ForwardRule : RuleBase
2543
{

‎Papercut.Module.Seq/AddSeqToConfiguration.cs

-4
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,12 @@ public AddSeqToConfiguration(ISettingStore settingStore)
3333
_settingStore = settingStore;
3434
}
3535

36-
#region Public Methods and Operators
37-
3836
public void Handle(ConfigureLoggerEvent @event)
3937
{
4038
var seqEndPoint = _settingStore.Get("SeqEndpoint", "http://localhost:5341");
4139
var logLevel = _settingStore.Get<LogEventLevel>("SeqLogLevel", LogEventLevel.Verbose);
4240

4341
@event.LogConfiguration.WriteTo.Seq(seqEndPoint, logLevel);
4442
}
45-
46-
#endregion
4743
}
4844
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("Papercut.Module.VerboseJsonLog")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("Jaben Cargman")]
12+
[assembly: AssemblyProduct("Papercut.Module.VerboseJsonLog")]
13+
[assembly: AssemblyCopyright("Copyright © 2014")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("30e03de3-850f-4ec4-9b25-f2514f9591a8")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]

‎Papercut.sln

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 2012
3+
# Visual Studio 2013
4+
VisualStudioVersion = 12.0.30723.0
5+
MinimumVisualStudioVersion = 10.0.40219.1
46
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Papercut", "src\Papercut.csproj", "{AC067042-66BD-4110-ADA1-E2CEA43E7947}"
57
EndProject
68
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Papercut.Core", "Papercut.Core\Papercut.Core.csproj", "{EEDD1016-6442-48CE-8F8E-1D350829FBDE}"
@@ -18,6 +20,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{C16CD0
1820
.nuget\NuGet.targets = .nuget\NuGet.targets
1921
EndProjectSection
2022
EndProject
23+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Papercut.Module.VerboseJsonLog", "Papercut.Module.VerboseJsonLog\Papercut.Module.VerboseJsonLog.csproj", "{F60D44E1-100E-464A-A280-CA6BAF652177}"
24+
EndProject
2125
Global
2226
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2327
Debug|Any CPU = Debug|Any CPU
@@ -39,11 +43,16 @@ Global
3943
{5E6526B3-4DA9-41F4-8171-C34146AC2E55}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
4044
{5E6526B3-4DA9-41F4-8171-C34146AC2E55}.Release|Any CPU.ActiveCfg = Release|Any CPU
4145
{5E6526B3-4DA9-41F4-8171-C34146AC2E55}.Release|Any CPU.Build.0 = Release|Any CPU
46+
{F60D44E1-100E-464A-A280-CA6BAF652177}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
47+
{F60D44E1-100E-464A-A280-CA6BAF652177}.Debug|Any CPU.Build.0 = Debug|Any CPU
48+
{F60D44E1-100E-464A-A280-CA6BAF652177}.Release|Any CPU.ActiveCfg = Release|Any CPU
49+
{F60D44E1-100E-464A-A280-CA6BAF652177}.Release|Any CPU.Build.0 = Release|Any CPU
4250
EndGlobalSection
4351
GlobalSection(SolutionProperties) = preSolution
4452
HideSolutionNode = FALSE
4553
EndGlobalSection
4654
GlobalSection(NestedProjects) = preSolution
4755
{5E6526B3-4DA9-41F4-8171-C34146AC2E55} = {8B3498DF-6DDE-44F5-8428-1B82749933BE}
56+
{F60D44E1-100E-464A-A280-CA6BAF652177} = {8B3498DF-6DDE-44F5-8428-1B82749933BE}
4857
EndGlobalSection
4958
EndGlobal

‎packages/repositories.config

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<repositories>
33
<repository path="..\Papercut.Core\packages.config" />
44
<repository path="..\Papercut.Module.Seq\packages.config" />
5+
<repository path="..\Papercut.Module.VerboseJsonLog\packages.config" />
56
<repository path="..\Papercut.Service\packages.config" />
67
<repository path="..\src\packages.config" />
78
</repositories>

‎src/Helpers/CalburnSerilogBridge.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public void Info(string format, params object[] args)
3636
{
3737
if (!format.StartsWith("Action Convention Not Applied"))
3838
{
39-
_logger.Value.Debug(format, args);
39+
_logger.Value.Verbose(format, args);
4040
}
4141
}
4242

0 commit comments

Comments
 (0)
Please sign in to comment.