Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to disable logging #370

Closed
frlu05 opened this issue May 25, 2017 · 14 comments
Closed

Add option to disable logging #370

frlu05 opened this issue May 25, 2017 · 14 comments

Comments

@frlu05
Copy link

frlu05 commented May 25, 2017

Hi!

I'm using SynTrayzor as a "sync server" on a low power computer with an external USB HDD . I've discovered that, even when I deselected all Setting / Folders / Watched & Notifications, SynctTrayzor is constantly accessing the disk.

If I start the Syncthing only, using the same Synthing config & db as above, the disk "goes to rest" after rescans and updates from other devices.

Is there a way to make SyncTrayzor (1) competely stop monitoring (then using Syncthing's rescan instead) and or (2) scan/monitor with a longer interval?

@canton7
Copy link
Owner

canton7 commented May 25, 2017

If you disable the "Watched" stuff in Folders, then SyncTrayzor will not monitor files for changes and will instead let Syncthing can files according to its rescan interval.

Another thing it could be is the conflict file monitoring (although that should only trigger for files with the .sync-conflict extension. You can disable it in "Alerts / Alert me of conflicted files".

If that doesn't help, see what file(s) it's accessing using the Windows Resource Monitor. Maybe it's a log file or something.

@frlu05
Copy link
Author

frlu05 commented May 25, 2017

The "Alerts" doesn't make a difference, but I see that the logfile is being constantly updated.

Is there a way to disable logging?

@canton7
Copy link
Owner

canton7 commented May 25, 2017 via email

@canton7
Copy link
Owner

canton7 commented May 25, 2017

Right, find and edit SyncTrayzor.exe.config, and remove this line: <logger name="*" minlevel="Debug" writeTo="logfile" />.

Note that that file will be overwritten when you upgrade. I'll put in a switch to disable logging though.

@canton7 canton7 changed the title Constant disk usage / IO even without monitoring Add option to disable logging May 25, 2017
@canton7
Copy link
Owner

canton7 commented May 25, 2017

Actually, scrap that. I implemented a control to change the log level, and defaulted it to a much lower level. You can grab an intermediate build with that here: https://ci.appveyor.com/project/canton7/synctrayzor/build/1.1.16.466/artifacts

@frlu05
Copy link
Author

frlu05 commented May 26, 2017

When trying access "Settings", it crashed...

Did I do something wrong? I'm running SyncTrayzor in portable mode, so to test the new version I downloaded SyncTrayzorPortable-x64.zip, extracted and copied my "data" library into the "new" SyncTrayzor folder. SyncTrayzor & Syncthing seems to start fine, but when I open File / Settings it crashes with:

Version: 1.1.16.466; Variant: Portable; Arch: Amd64
Path: C:\Users\Admin\Desktop\SyncTrayzorPortable-x64\SyncTrayzorPortable-x64\SyncTrayzor.exe
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Windows.Markup.XamlParseException: Add value to collection of type 'System.Windows.Controls.UIElementCollection' threw an exception. ---> System.ArgumentException: Cannot add instance of type 'String' to a collection of type 'UIElementCollection'. Only items of type 'UIElement' are allowed.
   at System.Windows.Controls.UIElementCollection.Cast(Object value)
   at System.Windows.Controls.UIElementCollection.System.Collections.IList.Add(Object value)
   at MS.Internal.Xaml.Runtime.ClrObjectRuntime.Add(Object collection, XamlType collectionType, Object value, XamlType valueXamlType)
   --- End of inner exception stack trace ---
   at System.Windows.Markup.XamlReader.RewrapException(Exception e, IXamlLineInfo lineInfo, Uri baseUri)
   at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
   at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
   at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Stylet.ViewManager.InitializeView(UIElement view, Type viewType) in c:\projects\stylet\Stylet\ViewManager.cs:line 332
   at Stylet.ViewManager.CreateViewForModel(Object model) in c:\projects\stylet\Stylet\ViewManager.cs:line 317
   at Stylet.ViewManager.CreateAndBindViewForModel(Object model) in c:\projects\stylet\Stylet\ViewManager.cs:line 224
   at Stylet.WindowManager.CreateWindow(Object viewModel, Boolean isDialog) in c:\projects\stylet\Stylet\WindowManager.cs:line 145
   at Stylet.WindowManager.ShowDialog(Object viewModel) in c:\projects\stylet\Stylet\WindowManager.cs:line 102
   at SyncTrayzor.Pages.ShellViewModel.ShowSettings() in C:\projects\synctrayzor\src\SyncTrayzor\Pages\ShellViewModel.cs:line 131
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Stylet.Xaml.ActionBase.InvokeTargetMethod(Object[] parameters) in c:\projects\stylet\Stylet\Xaml\ActionBase.cs:line 201
   at MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource commandSource, Boolean userInitiated)
   at System.Windows.Controls.MenuItem.InvokeClickAfterRender(Object arg)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

@canton7
Copy link
Owner

canton7 commented May 26, 2017

Interesting... I'll dig into this later. For now, go back to the last released version.

@frlu05
Copy link
Author

frlu05 commented May 26, 2017

So I've done...

I've now also tried to other solution, to delete the line in "SyncTrayzor.exe.config". That stopped to the log updates, but I can see that cookies and cookies-journal in \cef\cache are constantly updated?

And thanks a lot for both excellent SW and excellent help!

@canton7
Copy link
Owner

canton7 commented May 26, 2017

I'm not sure there's much I can do about that - that's the embedded browser doing its thing. It should only do that when SyncTrayzor is open though, I think?

You can change the <CefCachePath> in the same file, to change where those files are saved, if you want.

@frlu05
Copy link
Author

frlu05 commented May 26, 2017

Yes, closing the GUI did the trick - The disk went to sleep... I don't change the folder, I have data & SW all stored in a VeraCrypt container to be able to "bring the data anywhere".

@frlu05
Copy link
Author

frlu05 commented May 26, 2017

After some more testing

  • After deactivating logging and closing GUI there's no disk usage, even with "folder watching" activated on all folders
    UNLESS
  • There's another node with active Syncthing (Android, Windows Syncthing or Windows SyncTrayzor), then there's disk activity every minute or so.

But I guess that's part of Syncthing?

@canton7 canton7 closed this as completed in 48a6f3c Sep 4, 2017
@rdslw
Copy link

rdslw commented Apr 29, 2018

@canton7 looks like that newest release of SyncTrayzor is creating debug.log file (and logs into it) in addition to all normal logging taking place to logs/*

debug.log is being created on the same level as 'logs' directory is.

How can I disable it?

Example content:

[0429/154742:INFO:CONSOLE(546)] "refreshConnections", source: http://localhost:8384/syncthing/core/syncthingController.js (546)
[0429/154751:INFO:CONSOLE(694)] "refreshfolderStats", source: http://localhost:8384/syncthing/core/syncthingController.js (694)
[0429/154751:INFO:CONSOLE(709)] "refreshGlobalChanges", source: http://localhost:8384/syncthing/core/syncthingController.js (709)
[0429/154751:INFO:CONSOLE(498)] "recalcCompletion", source: http://localhost:8384/syncthing/core/syncthingController.js (498)
[0429/154752:INFO:CONSOLE(436)] "refreshSystem", source: http://localhost:8384/syncthing/core/syncthingController.js (436)
[0429/154752:INFO:CONSOLE(452)] "refreshDiscoveryCache", source: http://localhost:8384/syncthing/core/syncthingController.js (452)
[0429/154752:INFO:CONSOLE(553)] "refreshErrors", source: http://localhost:8384/syncthing/core/syncthingController.js (553)
[0429/154752:INFO:CONSOLE(546)] "refreshConnections", source: http://localhost:8384/syncthing/core/syncthingController.js (546)

@canton7
Copy link
Owner

canton7 commented Apr 29, 2018

Nothing's changed in that respect. This this build? https://ci.appveyor.com/project/canton7/synctrayzor/build/1.1.21.518/artifacts

@rdslw
Copy link

rdslw commented Apr 29, 2018

I don't know at which release debug.log started to appear.

Anyway, after trying release from your link, debug.log is not being created any more. thank you!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants