diff options
| author | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2019-11-24 16:39:46 +0200 |
|---|---|---|
| committer | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2019-11-24 16:39:46 +0200 |
| commit | 6c57a826a4287b1ca3ea418fcc2aed50ed129bdc (patch) | |
| tree | 76a3fc419861d2ebdb9e345a35e58cf37f3cde21 /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs | |
| parent | d2edfc56a8154c01a7ca9cfc47adccc8a07c3d94 (diff) | |
| download | Tango-6c57a826a4287b1ca3ea418fcc2aed50ed129bdc.tar.gz Tango-6c57a826a4287b1ca3ea418fcc2aed50ed129bdc.zip | |
Implemented AutoLogRemoval & MaxFileSizeLimit to FileLogger, LogFileParser and TFS bug reporting!!!
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs index 8309500b7..94f98feb2 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/App.xaml.cs @@ -23,13 +23,14 @@ using Tango.MachineStudio.UI.Views; using Tango.MachineStudio.Common; using Tango.Core; using Tango.BL; +using Tango.Integration.Operation; namespace Tango.MachineStudio.UI { /// <summary> /// Interaction logic for App.xaml /// </summary> - public partial class App : Application + public partial class App : Application { private WpfGlobalExceptionTrapper exceptionTrapper; private LogManager LogManager = LogManager.Default; @@ -61,7 +62,14 @@ namespace Tango.MachineStudio.UI #if DEBUG LogManager.RegisterLogger(new VSOutputLogger()); #endif - LogManager.RegisterLogger(new FileLogger()); + LogManager.RegisterLogger(new FileLogger() { EnableAutoLogRemoval = true, EnableMaxFileSizeLimit = true }); + + var operatorLogger = MachineOperator.EmbeddedLogManager.RegisteredLoggers.SingleOrDefault(x => x is FileLogger) as FileLogger; + if (operatorLogger != null) + { + operatorLogger.EnableAutoLogRemoval = true; + operatorLogger.EnableMaxFileSizeLimit = true; + } LogManager.Log("Application Started..."); @@ -89,7 +97,13 @@ namespace Tango.MachineStudio.UI exceptionTrapper.Initialize(this); exceptionTrapper.ApplicationCrashed += ExceptionTrapper_ApplicationCrashed; - //Apply Caching + ApplyEFCacheSettings(); + } + + private void ApplyEFCacheSettings() + { + var settings = SettingsManager.Default.GetOrCreate<MachineStudioSettings>(); + if (settings.CachingMode != ObservablesContextInMemoryCachingMode.None) { LogManager.Log("EF Caching is enabled."); @@ -108,9 +122,7 @@ namespace Tango.MachineStudio.UI { LogManager.Log("EF Caching is disabled"); } - } - #region Global Exception Trapping |
