Skip to content

Commit a446ce6

Browse files
committed
Adding a target for writing to windows event log.
1 parent 78d9ff3 commit a446ce6

10 files changed

Lines changed: 1520 additions & 1085 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"targets": [
3+
{
4+
"name": "windowsEventLog",
5+
"type": "NuLog.Targets.WindowsEventLogTarget",
6+
"layout": "${Tags} - ${Message}\r\n",
7+
"EventLogEntryType": "Error"
8+
}
9+
],
10+
"rules": [
11+
{
12+
"include": [ "windowsEventLog" ],
13+
"writeTo": [ "windowsEventLog" ],
14+
"final": true
15+
}
16+
],
17+
"watch": true
18+
}
Lines changed: 134 additions & 131 deletions
Original file line numberDiff line numberDiff line change
@@ -1,138 +1,141 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4-
<PropertyGroup>
5-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7-
<ProjectGuid>{5A75F592-EC12-47BE-A299-FABD8EF3BE6E}</ProjectGuid>
8-
<OutputType>Exe</OutputType>
9-
<AppDesignerFolder>Properties</AppDesignerFolder>
10-
<RootNamespace>NuLog.ConsoleTest</RootNamespace>
11-
<AssemblyName>NuLog.ConsoleTest</AssemblyName>
12-
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
13-
<FileAlignment>512</FileAlignment>
14-
</PropertyGroup>
15-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16-
<PlatformTarget>AnyCPU</PlatformTarget>
17-
<DebugSymbols>true</DebugSymbols>
18-
<DebugType>full</DebugType>
19-
<Optimize>false</Optimize>
20-
<OutputPath>bin\Debug\</OutputPath>
21-
<DefineConstants>DEBUG;TRACE</DefineConstants>
22-
<ErrorReport>prompt</ErrorReport>
23-
<WarningLevel>4</WarningLevel>
24-
</PropertyGroup>
25-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26-
<PlatformTarget>AnyCPU</PlatformTarget>
27-
<DebugType>pdbonly</DebugType>
28-
<Optimize>true</Optimize>
29-
<OutputPath>bin\Release\</OutputPath>
30-
<DefineConstants>TRACE</DefineConstants>
31-
<ErrorReport>prompt</ErrorReport>
32-
<WarningLevel>4</WarningLevel>
33-
</PropertyGroup>
34-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release-Net4.5|AnyCPU'">
35-
<OutputPath>bin\Release-Net4.5\</OutputPath>
36-
<DefineConstants>TRACE</DefineConstants>
37-
<Optimize>true</Optimize>
38-
<DebugType>pdbonly</DebugType>
39-
<PlatformTarget>AnyCPU</PlatformTarget>
40-
<ErrorReport>prompt</ErrorReport>
41-
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
42-
<Prefer32Bit>true</Prefer32Bit>
43-
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
44-
</PropertyGroup>
45-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release-Net4.5.1|AnyCPU'">
46-
<OutputPath>bin\Release-Net4.5.1\</OutputPath>
47-
<DefineConstants>TRACE</DefineConstants>
48-
<Optimize>true</Optimize>
49-
<DebugType>pdbonly</DebugType>
50-
<PlatformTarget>AnyCPU</PlatformTarget>
51-
<ErrorReport>prompt</ErrorReport>
52-
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
53-
<Prefer32Bit>true</Prefer32Bit>
54-
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
55-
</PropertyGroup>
56-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release-Net4.5.2|AnyCPU'">
57-
<OutputPath>bin\Release-Net4.5.2\</OutputPath>
58-
<DefineConstants>TRACE</DefineConstants>
59-
<Optimize>true</Optimize>
60-
<DebugType>pdbonly</DebugType>
61-
<PlatformTarget>AnyCPU</PlatformTarget>
62-
<ErrorReport>prompt</ErrorReport>
63-
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
64-
<Prefer32Bit>true</Prefer32Bit>
65-
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
66-
</PropertyGroup>
67-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release-Net4.6|AnyCPU'">
68-
<OutputPath>bin\Release-Net4.6\</OutputPath>
69-
<DefineConstants>TRACE</DefineConstants>
70-
<Optimize>true</Optimize>
71-
<DebugType>pdbonly</DebugType>
72-
<PlatformTarget>AnyCPU</PlatformTarget>
73-
<ErrorReport>prompt</ErrorReport>
74-
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
75-
<Prefer32Bit>true</Prefer32Bit>
76-
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
77-
</PropertyGroup>
78-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release-4.6.1|AnyCPU'">
79-
<OutputPath>bin\Release-Net4.6.1\</OutputPath>
80-
<DefineConstants>TRACE</DefineConstants>
81-
<Optimize>true</Optimize>
82-
<DebugType>pdbonly</DebugType>
83-
<PlatformTarget>AnyCPU</PlatformTarget>
84-
<ErrorReport>prompt</ErrorReport>
85-
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
86-
<Prefer32Bit>true</Prefer32Bit>
87-
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
88-
</PropertyGroup>
89-
<ItemGroup>
90-
<Reference Include="System" />
91-
<Reference Include="System.Core" />
92-
<Reference Include="System.Xml.Linq" />
93-
<Reference Include="System.Data.DataSetExtensions" />
94-
<Reference Include="Microsoft.CSharp" />
95-
<Reference Include="System.Data" />
96-
<Reference Include="System.Xml" />
97-
</ItemGroup>
98-
<ItemGroup>
99-
<Compile Include="Program.cs" />
100-
<Compile Include="Properties\AssemblyInfo.cs" />
101-
</ItemGroup>
102-
<ItemGroup>
103-
<None Include="App.config" />
104-
<None Include="Configs\SyncColorConsole.json">
105-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
106-
</None>
107-
<None Include="Configs\ColorConsole.json">
108-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
109-
</None>
110-
<None Include="Configs\SyncConsole.json">
111-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
112-
</None>
113-
<None Include="Configs\SyncFile.json">
114-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
115-
</None>
116-
<None Include="Configs\File.json">
117-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
118-
</None>
119-
<None Include="Configs\Console.json">
120-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
121-
</None>
122-
</ItemGroup>
123-
<ItemGroup>
124-
<ProjectReference Include="..\NuLog\NuLog.csproj">
125-
<Project>{4390fde4-942c-4a64-ae05-899f60f6b5e5}</Project>
126-
<Name>NuLog</Name>
127-
</ProjectReference>
128-
</ItemGroup>
129-
<ItemGroup />
130-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{5A75F592-EC12-47BE-A299-FABD8EF3BE6E}</ProjectGuid>
8+
<OutputType>Exe</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>NuLog.ConsoleTest</RootNamespace>
11+
<AssemblyName>NuLog.ConsoleTest</AssemblyName>
12+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
</PropertyGroup>
15+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16+
<PlatformTarget>AnyCPU</PlatformTarget>
17+
<DebugSymbols>true</DebugSymbols>
18+
<DebugType>full</DebugType>
19+
<Optimize>false</Optimize>
20+
<OutputPath>bin\Debug\</OutputPath>
21+
<DefineConstants>DEBUG;TRACE</DefineConstants>
22+
<ErrorReport>prompt</ErrorReport>
23+
<WarningLevel>4</WarningLevel>
24+
</PropertyGroup>
25+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26+
<PlatformTarget>AnyCPU</PlatformTarget>
27+
<DebugType>pdbonly</DebugType>
28+
<Optimize>true</Optimize>
29+
<OutputPath>bin\Release\</OutputPath>
30+
<DefineConstants>TRACE</DefineConstants>
31+
<ErrorReport>prompt</ErrorReport>
32+
<WarningLevel>4</WarningLevel>
33+
</PropertyGroup>
34+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release-Net4.5|AnyCPU'">
35+
<OutputPath>bin\Release-Net4.5\</OutputPath>
36+
<DefineConstants>TRACE</DefineConstants>
37+
<Optimize>true</Optimize>
38+
<DebugType>pdbonly</DebugType>
39+
<PlatformTarget>AnyCPU</PlatformTarget>
40+
<ErrorReport>prompt</ErrorReport>
41+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
42+
<Prefer32Bit>true</Prefer32Bit>
43+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
44+
</PropertyGroup>
45+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release-Net4.5.1|AnyCPU'">
46+
<OutputPath>bin\Release-Net4.5.1\</OutputPath>
47+
<DefineConstants>TRACE</DefineConstants>
48+
<Optimize>true</Optimize>
49+
<DebugType>pdbonly</DebugType>
50+
<PlatformTarget>AnyCPU</PlatformTarget>
51+
<ErrorReport>prompt</ErrorReport>
52+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
53+
<Prefer32Bit>true</Prefer32Bit>
54+
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
55+
</PropertyGroup>
56+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release-Net4.5.2|AnyCPU'">
57+
<OutputPath>bin\Release-Net4.5.2\</OutputPath>
58+
<DefineConstants>TRACE</DefineConstants>
59+
<Optimize>true</Optimize>
60+
<DebugType>pdbonly</DebugType>
61+
<PlatformTarget>AnyCPU</PlatformTarget>
62+
<ErrorReport>prompt</ErrorReport>
63+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
64+
<Prefer32Bit>true</Prefer32Bit>
65+
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
66+
</PropertyGroup>
67+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release-Net4.6|AnyCPU'">
68+
<OutputPath>bin\Release-Net4.6\</OutputPath>
69+
<DefineConstants>TRACE</DefineConstants>
70+
<Optimize>true</Optimize>
71+
<DebugType>pdbonly</DebugType>
72+
<PlatformTarget>AnyCPU</PlatformTarget>
73+
<ErrorReport>prompt</ErrorReport>
74+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
75+
<Prefer32Bit>true</Prefer32Bit>
76+
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
77+
</PropertyGroup>
78+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release-4.6.1|AnyCPU'">
79+
<OutputPath>bin\Release-Net4.6.1\</OutputPath>
80+
<DefineConstants>TRACE</DefineConstants>
81+
<Optimize>true</Optimize>
82+
<DebugType>pdbonly</DebugType>
83+
<PlatformTarget>AnyCPU</PlatformTarget>
84+
<ErrorReport>prompt</ErrorReport>
85+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
86+
<Prefer32Bit>true</Prefer32Bit>
87+
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
88+
</PropertyGroup>
89+
<ItemGroup>
90+
<Reference Include="System" />
91+
<Reference Include="System.Core" />
92+
<Reference Include="System.Xml.Linq" />
93+
<Reference Include="System.Data.DataSetExtensions" />
94+
<Reference Include="Microsoft.CSharp" />
95+
<Reference Include="System.Data" />
96+
<Reference Include="System.Xml" />
97+
</ItemGroup>
98+
<ItemGroup>
99+
<Compile Include="Program.cs" />
100+
<Compile Include="Properties\AssemblyInfo.cs" />
101+
</ItemGroup>
102+
<ItemGroup>
103+
<None Include="App.config" />
104+
<None Include="Configs\WindowsEventLog.json">
105+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
106+
</None>
107+
<None Include="Configs\SyncColorConsole.json">
108+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
109+
</None>
110+
<None Include="Configs\ColorConsole.json">
111+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
112+
</None>
113+
<None Include="Configs\SyncConsole.json">
114+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
115+
</None>
116+
<None Include="Configs\SyncFile.json">
117+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
118+
</None>
119+
<None Include="Configs\File.json">
120+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
121+
</None>
122+
<None Include="Configs\Console.json">
123+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
124+
</None>
125+
</ItemGroup>
126+
<ItemGroup>
127+
<ProjectReference Include="..\NuLog\NuLog.csproj">
128+
<Project>{4390fde4-942c-4a64-ae05-899f60f6b5e5}</Project>
129+
<Name>NuLog</Name>
130+
</ProjectReference>
131+
</ItemGroup>
132+
<ItemGroup />
133+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
131134
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
132135
Other similar extension points exist, see Microsoft.Common.targets.
133136
<Target Name="BeforeBuild">
134137
</Target>
135138
<Target Name="AfterBuild">
136139
</Target>
137-
-->
140+
-->
138141
</Project>

0 commit comments

Comments
 (0)