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

2.0db023 SetBinaryLogDirectory(string) path ignored, still written to AppContext.BaseDirectory #994

Closed
bdgza opened this issue Mar 15, 2018 · 2 comments
Assignees
Milestone

Comments

@bdgza
Copy link

bdgza commented Mar 15, 2018

Couchbase Lite version 2.0db023. Windows 10 1709, .NET 4.7.1, Windows Forms.

The method Couchbase.Lite.Support.NetDesktop.SetBinaryLogDirectory(string) added for #964 doesn't work. The binary log files still get written to AppContext.BaseDirectory next to the exe as before. The similar Couchbase.Lite.Support.NetDesktop.EnableTextLogging(string) does work as expected, and writes the text logs to the given path.

Reproduce

Create a new project, add the Couchbase Lite and Couchbase Lite NetDesktop Support NuGets. Write:

Couchbase.Lite.Support.NetDesktop.Activate();
Couchbase.Lite.Support.NetDesktop.SetBinaryLogDirectory(@"C:\Users\username\Desktop\LogTestBinary\");
Couchbase.Lite.Support.NetDesktop.EnableTextLogging(@"C:\Users\username\Desktop\LogTest\");

LogTest will be created on the desktop, LogTestBinary will not. Instead the binary logs will appear in the default directory next to the exe.

@borrrden
Copy link
Member

Try calling it before the call to Activate()

@borrrden
Copy link
Member

Nevermind...that's not going to work since the static constructor will initialize the binary logger before that method takes effect -_-. I have an idea of what to do though.

@borrrden borrrden added the bug label Mar 15, 2018
@borrrden borrrden added this to the 2.0.0 milestone Mar 15, 2018
@borrrden borrrden self-assigned this Mar 15, 2018
@borrrden borrrden removed the ready label Mar 16, 2018
jamesnocentini pushed a commit that referenced this issue Mar 16, 2018
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