Index: Application/Riskeer/src/Application.Riskeer/App.cs =================================================================== diff -u -r306534a774a4391bfb8c021ecda9b2ee1ce1d309 -r48814d5ba84cbc9db0d6b1b835e603da18d36357 --- Application/Riskeer/src/Application.Riskeer/App.cs (.../App.cs) (revision 306534a774a4391bfb8c021ecda9b2ee1ce1d309) +++ Application/Riskeer/src/Application.Riskeer/App.cs (.../App.cs) (revision 48814d5ba84cbc9db0d6b1b835e603da18d36357) @@ -92,7 +92,8 @@ private void Initialize() { - Logger.Setup(); + LogConfigurator.Initialize(); + log = LogManager.GetLogger(typeof(App)); SettingsHelper.Instance = new RiskeerSettingsHelper(); @@ -119,7 +120,7 @@ DeleteOldLogFiles(); Resources.Add(SystemParameters.MenuPopupAnimationKey, PopupAnimation.None); - + var settings = new GuiCoreSettings { SupportEmailAddress = "www.helpdeskwater.nl", Index: Application/Riskeer/src/Application.Riskeer/LogConfigurator.cs =================================================================== diff -u --- Application/Riskeer/src/Application.Riskeer/LogConfigurator.cs (revision 0) +++ Application/Riskeer/src/Application.Riskeer/LogConfigurator.cs (revision 48814d5ba84cbc9db0d6b1b835e603da18d36357) @@ -0,0 +1,69 @@ +// Copyright (C) Stichting Deltares 2019. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.IO; +using Core.Common.Gui.Forms.MessageWindow; +using Core.Common.Util.Settings; +using log4net; +using log4net.Appender; +using log4net.Core; +using log4net.Layout; +using log4net.Repository.Hierarchy; + +namespace Application.Riskeer +{ + /// + /// Class for managing the logging capabilities of Riskeer. + /// + public static class Logger + { + /// + /// Sets the configuration of the logger. + /// + public static void Setup() + { + var hierarchy = (Hierarchy) LogManager.GetRepository(); + + var patternLayout = new PatternLayout + { + ConversionPattern = "%date [%thread] %-5level %logger - %message%newline" + }; + patternLayout.ActivateOptions(); + + var roller = new FileAppender + { + AppendToFile = false, + File = Path.Combine(SettingsHelper.Instance.GetApplicationLocalUserSettingsDirectory(), "BOI", "Riskeer", "Riskeer-") + DateTime.Now.ToString("yyyy.MMM.dd.HH.mm.ss") + ".log", + Layout = patternLayout + }; + + roller.ActivateOptions(); + hierarchy.Root.AddAppender(roller); + + var messageWindowLogAppender = new MessageWindowLogAppender(); + hierarchy.Root.AddAppender(messageWindowLogAppender); + + hierarchy.Root.Level = Level.Debug; + hierarchy.Configured = true; + } + } +} \ No newline at end of file Fisheye: Tag 48814d5ba84cbc9db0d6b1b835e603da18d36357 refers to a dead (removed) revision in file `Application/Riskeer/src/Application.Riskeer/Logger.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Application/Riskeer/test/Application.Riskeer.Test/Application.Riskeer.Test.csproj =================================================================== diff -u -r08e8d26a0715f0f3db57c1d3e86256aa06934db4 -r48814d5ba84cbc9db0d6b1b835e603da18d36357 --- Application/Riskeer/test/Application.Riskeer.Test/Application.Riskeer.Test.csproj (.../Application.Riskeer.Test.csproj) (revision 08e8d26a0715f0f3db57c1d3e86256aa06934db4) +++ Application/Riskeer/test/Application.Riskeer.Test/Application.Riskeer.Test.csproj (.../Application.Riskeer.Test.csproj) (revision 48814d5ba84cbc9db0d6b1b835e603da18d36357) @@ -15,10 +15,10 @@ - - - - + + + + Index: Application/Riskeer/test/Application.Riskeer.Test/LogConfiguratorTest.cs =================================================================== diff -u --- Application/Riskeer/test/Application.Riskeer.Test/LogConfiguratorTest.cs (revision 0) +++ Application/Riskeer/test/Application.Riskeer.Test/LogConfiguratorTest.cs (revision 48814d5ba84cbc9db0d6b1b835e603da18d36357) @@ -0,0 +1,59 @@ +// Copyright (C) Stichting Deltares 2019. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using Core.Common.Gui.Forms.MessageWindow; +using log4net; +using log4net.Appender; +using log4net.Core; +using log4net.Repository.Hierarchy; +using NUnit.Framework; + +namespace Application.Riskeer.Test +{ + [TestFixture] + public class LogConfiguratorTest + { + [Test] + public void Initialize_Always_SetsExpectedHierarchyValues() + { + // Call + LogConfigurator.Initialize(); + + // Assert + var hierarchy = (Hierarchy) LogManager.GetRepository(); + Assert.AreEqual(Level.Debug, hierarchy.Root.Level); + Assert.IsTrue(hierarchy.Configured); + } + + [Test] + public void Initialize_Always_AddsExpectedLogAppenders() + { + // Call + LogConfigurator.Initialize(); + + // Assert + var hierarchy = (Hierarchy) LogManager.GetRepository(); + Assert.AreEqual(2, hierarchy.Root.Appenders.Count); + Assert.IsInstanceOf(hierarchy.Root.Appenders[0]); + Assert.IsInstanceOf(hierarchy.Root.Appenders[1]); + } + } +} \ No newline at end of file Fisheye: Tag 48814d5ba84cbc9db0d6b1b835e603da18d36357 refers to a dead (removed) revision in file `Application/Riskeer/test/Application.Riskeer.Test/LoggerTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Core/Common/src/Core.Common.Assembly/AssemblyResolver.cs =================================================================== diff -u -rf47163c2cebf58b247a5f9809c88164ec8536098 -r48814d5ba84cbc9db0d6b1b835e603da18d36357 --- Core/Common/src/Core.Common.Assembly/AssemblyResolver.cs (.../AssemblyResolver.cs) (revision f47163c2cebf58b247a5f9809c88164ec8536098) +++ Core/Common/src/Core.Common.Assembly/AssemblyResolver.cs (.../AssemblyResolver.cs) (revision 48814d5ba84cbc9db0d6b1b835e603da18d36357) @@ -45,7 +45,7 @@ /// /// Assembly_1.dll /// - /// b + /// /// /// /// @@ -103,6 +103,9 @@ /// Assembly_4.dll /// /// + /// Assembly_5.dll + /// + /// /// Assembly_6.dll /// /// Index: Core/Common/test/Core.Common.Util.Test/Reflection/AssemblyUtilsTest.cs =================================================================== diff -u -r3c64407303b0747af9311ce346df9d8966971956 -r48814d5ba84cbc9db0d6b1b835e603da18d36357 --- Core/Common/test/Core.Common.Util.Test/Reflection/AssemblyUtilsTest.cs (.../AssemblyUtilsTest.cs) (revision 3c64407303b0747af9311ce346df9d8966971956) +++ Core/Common/test/Core.Common.Util.Test/Reflection/AssemblyUtilsTest.cs (.../AssemblyUtilsTest.cs) (revision 48814d5ba84cbc9db0d6b1b835e603da18d36357) @@ -153,7 +153,7 @@ } [Test] - public void GetAssemblyResourceStream_ForNonexistingEmbeddedResource_ThrowArgumentException() + public void GetAssemblyResourceStream_ForNonExistingEmbeddedResource_ThrowArgumentException() { // Call void Call() => AssemblyUtils.GetAssemblyResourceStream(GetType().Assembly, "I do not exist.txt"); Index: Riskeer/HydraRing/src/Riskeer.HydraRing.IO/Riskeer.HydraRing.IO.csproj =================================================================== diff -u -re256c94ccd3f758cf0b4d6dcb4947fce096c5f4e -r48814d5ba84cbc9db0d6b1b835e603da18d36357 --- Riskeer/HydraRing/src/Riskeer.HydraRing.IO/Riskeer.HydraRing.IO.csproj (.../Riskeer.HydraRing.IO.csproj) (revision e256c94ccd3f758cf0b4d6dcb4947fce096c5f4e) +++ Riskeer/HydraRing/src/Riskeer.HydraRing.IO/Riskeer.HydraRing.IO.csproj (.../Riskeer.HydraRing.IO.csproj) (revision 48814d5ba84cbc9db0d6b1b835e603da18d36357) @@ -42,8 +42,8 @@ - + \ No newline at end of file