Welcome, Guest

Author Topic: disable debug.log and Coherent_Browser.log  (Read 649 times)

willy

  • Posts: 4
    • View Profile
disable debug.log and Coherent_Browser.log
« on: November 07, 2016, 03:54:44 AM »
In our product environment, the directory in which the CoherentUINetControls.dll was installed, is only reading access.
In the initial installation, these two files were not included, and when we tried to open a Coherent Web control, our program crashed.
are the "debug.log" and "Coherent_Browser.log" are must?  How to disable the generating of them?
« Last Edit: November 07, 2016, 04:00:27 AM by willy »

john.v

  • Administrator
  • *****
  • Posts: 54
    • View Profile
Re: disable debug.log and Coherent_Browser.log
« Reply #1 on: November 08, 2016, 04:27:04 AM »
Hi Willy,

I've verified your issue by removing these files and limiting the folder's access to read-only. You can disable the generation of these log files by setting a blank log handler in MainWindow.xaml.cs, like this:   

Code: [Select]
CoherentUI.LogHandler = new Coherent.UI.ILogHandler();

However, please keep in mind that the "debug.log" and "Coherent_Browser.log" files contain debug information that would prove useful if any problem arises.

John V.
Support Engineer at Coherent Labs

willy

  • Posts: 4
    • View Profile
Re: disable debug.log and Coherent_Browser.log
« Reply #2 on: November 09, 2016, 11:59:55 PM »
Thanks John,
     I tested you solution, and the Coherent_Browser.log was disabled successfully, but the debug.log was generated still, no matter whether my exe is debug version or release version.
     I aslo tried the following codes:
     public class DummyLogHandler : ILogHandler
    {
        public override void WriteLog(Severity severity, string message, uint length) { }
    }
   
    CoherentUI.LogHandler = new DummyLogHandler();
   
    But the debug.log was generated still.
    Are there any way to redirect these files, especially the debug.log to other file location?
   

john.v

  • Administrator
  • *****
  • Posts: 54
    • View Profile
Re: disable debug.log and Coherent_Browser.log
« Reply #3 on: November 14, 2016, 04:48:16 AM »
Hi willy,

There is no explicit way to set the debug.log file to be generated in a location other than the host directory. However, one way you can prevent it from generating is to raise the log severity to "Error" with

Code: [Select]
CoherentUI.LogSeverity = Coherent.UI.Severity.Error;

If you have any errors that are safe to ignore in your application, you can modify the LogHandler class to handle them. If this is not a viable solution for you, please provide us with more information regarding your use case. Why does the host directory have these restrictions with read access?

You can change the directory where the CoherentUI_Host.exe is and where the logs are generated to a one with no such restrictions. To do this, use the CoherentUI.HostDirectory property, like this:

Code: [Select]
CoherentUI.HostDirectory = "C:\\<path_to_custom_dir>"

John V.
Support Engineer at Coherent Labs

willy

  • Posts: 4
    • View Profile
Re: disable debug.log and Coherent_Browser.log
« Reply #4 on: November 16, 2016, 09:30:03 PM »
 Hi John,
 I have adopted the following codes:
     CoherentUI.LogHandler = new Coherent.UI.ILogHandler();
     CoherentUI.LogSeverity = Coherent.UI.Severity.Error;
Thanks for your solution. 
   
 My use case is like this:
     The exe was installed by the administrator into C:\Program Files, and this exe will be run by another ordinary user who have no write access to C:\Program Files.

Tags: