Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS will be completely phased out by mid-2025. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit 53be1077 authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

include logging also in test project

parent 3a46faa6
No related branches found
No related tags found
No related merge requests found
......@@ -3,10 +3,18 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Common.Logging;
namespace TUGraz.VectoCore.Models.SimulationComponent
{
public class SimulationComponentData
{
protected ILog Logger;
public SimulationComponentData()
{
Logger = LogManager.GetLogger(this.GetType());
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="common">
<section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" />
</sectionGroup>
<section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog" />
</configSections>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
......@@ -8,4 +14,20 @@
</dependentAssembly>
</assemblyBinding>
</runtime>
<common>
<logging>
<factoryAdapter type="Common.Logging.NLog.NLogLoggerFactoryAdapter, Common.Logging.NLog31">
<arg key="configType" value="INLINE"/>
</factoryAdapter>
</logging>
</common>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<targets>
<target xsi:type="Console" name="ConsoleLogger" error="true" />
<target xsi:type="File" name="LogFile" filename="${basedir}/logs/log.txt" layout="${longdate} [${processid}@${machinename}] ${callsite} ${level:uppercase=true}: ${message}" />
</targets>
<rules>
<logger name="*" minlevel="Info" writeTo="LogFile" />
</rules>
</nlog>
</configuration>
\ No newline at end of file
......@@ -35,6 +35,20 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Common.Logging, Version=3.0.0.0, Culture=neutral, PublicKeyToken=af08829b84f0328e, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Common.Logging.3.0.0\lib\net40\Common.Logging.dll</HintPath>
</Reference>
<Reference Include="Common.Logging.Core">
<HintPath>..\packages\Common.Logging.Core.3.0.0\lib\net40\Common.Logging.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Common.Logging.NLog31">
<HintPath>..\packages\Common.Logging.NLog31.3.0.0\lib\net40\Common.Logging.NLog31.dll</HintPath>
</Reference>
<Reference Include="NLog">
<HintPath>..\packages\NLog.3.2.0.0\lib\net45\NLog.dll</HintPath>
</Reference>
<Reference Include="System" />
</ItemGroup>
<Choose>
......@@ -61,6 +75,7 @@
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<Choose>
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
......
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="common">
<section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" />
</sectionGroup>
<section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog" />
</configSections>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
......@@ -8,4 +14,20 @@
</dependentAssembly>
</assemblyBinding>
</runtime>
<common>
<logging>
<factoryAdapter type="Common.Logging.NLog.NLogLoggerFactoryAdapter, Common.Logging.NLog31">
<arg key="configType" value="INLINE" />
</factoryAdapter>
</logging>
</common>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<targets>
<target xsi:type="Console" name="ConsoleLogger" error="true" />
<target xsi:type="File" name="LogFile" filename="${basedir}/logs/log.txt" layout="${longdate} [${processid}@${machinename}] ${callsite} ${level:uppercase=true}: ${message}" />
</targets>
<rules>
<logger name="*" minlevel="Info" writeTo="LogFile" />
</rules>
</nlog>
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Common.Logging" version="3.0.0" targetFramework="net45" />
<package id="Common.Logging.Core" version="3.0.0" targetFramework="net45" />
<package id="Common.Logging.NLog31" version="3.0.0" targetFramework="net45" />
<package id="NLog" version="3.2.0.0" targetFramework="net45" />
</packages>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment