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

v0.93 Windows - Cannot specify absolute path in log_file #606

Closed
AnthonyBe opened this issue Feb 27, 2019 · 3 comments
Closed

v0.93 Windows - Cannot specify absolute path in log_file #606

AnthonyBe opened this issue Feb 27, 2019 · 3 comments
Assignees
Milestone

Comments

@AnthonyBe
Copy link

I am trying to config AGH to generate a local log file rather than log to Windows Event Log by populating the log_file settnig in the config file. I can't seem to get it to work and everything permutation I try results in the AGH service not starting and an error being logged:

yaml: line 70: found unknown escape character

NOTE: The documentation for this setting states:
log_file — Path to the log file. If empty, writes to stdout, if syslog -- system log (or eventlog on Windows).
https://github.com/AdguardTeam/AdGuardHome/wiki/Configuration

Steps to reproduce

  1. Change log_file setting from "" to
  2. log_file: "c:\install\AdGuardHome"
  3. log_file: "c:\install\AdGuardHome"
  4. log_file: "c:\install\AdGuardHome\AGH.log"
    none of which worked and all generated the above error.

What finally worked was "log_file: AGH.log"

Could I suggest either:

  1. fixing the Wiki and remove the word 'path' and just say 'filename', OR
  2. Fix AGH so you can actually put a path in the setting.

Your environment

Description Value
Version of AdGuard Home server: v0.93
How did you setup DNS configuration: (System/Router/IoT)
If it's a router or IoT, please write device model: (e.g. Raspberry Pi 3 Model B)
Operating system and version: Windows Server 2012 R2
@ameshkov
Copy link
Member

try either c:/install/AdGuardHome or c:\\install\\AdGuardHome

@AnthonyBe
Copy link
Author

Sorry, forgot to mention that I'd tried c:/install/AdGuardHome (I'm used to working with UNIX ports to Windows forgetting to change forward-slashes to back-slashes :)

Both c:/install/AdGuardHome and c:\\install\\AdGuardHome failed with same error as original post.

@ameshkov ameshkov changed the title v0.93 Windows - Can't get local log_file to work v0.93 Windows - Cannot specify absolute path in log_file Feb 27, 2019
@ameshkov ameshkov added this to the v0.94 milestone Feb 27, 2019
@ameshkov
Copy link
Member

Yeah, on Windows there's an issue with specifying an absolute path which we should fix.

Even if you make it a valid YAML (by removing quotes or escaping \) it won't work anyway:

2019/02/27 15:06:56 cannot create a log file: open c:\AdGuardHome_v0.93_Windows\
c:\adguard.log: The filename, directory name, or volume label syntax is incorrec
t.

@szolin szolin closed this as completed in e9d2065 Mar 20, 2019
szolin pushed a commit that referenced this issue Mar 20, 2019
…bsolute path in log_file; Fix #606, Fix #610

* commit '70c56f7a180e1113c289574e69dd148bc76db511':
  + app, config: add symlink support, allow to specify absolute path in log_file
szolin pushed a commit that referenced this issue Mar 20, 2019
* commit '6b223e2992f45aaba7ae9d685a741bd76c23d284':
  * dnsfilter: extend logging
  Fix #606, Fix #610 [change] app, config: add symlink support, allow to specify absolute path in log_file
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