jumpsmm7 / Asuswrt-Merlin-AdGuardHome-Installer

The Official Installer of AdGuardHome for Asuswrt-Merlin
GNU General Public License v3.0
143 stars 15 forks source link

Log location doesn't work, still writes to syslog #218

Closed khadanja closed 4 months ago

khadanja commented 4 months ago

Set location here, can see logs in router gui. Not creating log file at the specified location. log: file: /mnt/Asus/entware/etc/AdGuardHome/AdGuardHome.log max_backups: 0 max_size: 100 max_age: 3 compress: false local_time: false verbose: true

jumpsmm7 commented 4 months ago

Set location here, can see logs in router gui. Not creating log file at the specified location. log: file: /mnt/Asus/entware/etc/AdGuardHome/AdGuardHome.log max_backups: 0 max_size: 100 max_age: 3 compress: false local_time: false verbose: true

That is because the log location is being specified inside the init.d script - "/opt/etc/init.d/S99AdGuardHome". You need to change the "syslog" inside the init.d script to the actual location of your logfile, then it will work i.e. "/opt/etc/AdGuardHome/AdGuardHome.log". Or simply change the line LOG_FILE="syslog" to #LOG_FILE="syslog" by commenting out the line. This will ensure that your listings in the .yaml file take priority.

https://github.com/jumpsmm7/Asuswrt-Merlin-AdGuardHome-Installer/blob/master/S99AdGuardHome#L5-L12

Just note, this is not an actual "issue" persay, it is a side-effect of the log location being specified in the launch command of AdGuardHome. The only way you will change this behavior is if the developers of AdGuardHome change the "default behavior" of log location priority. Currently the launch command log location variables get priority over the location specified in the .yaml file. This is not a behavior I can change without making it impossible for those who prefer "syslog", so I am closing this issue you have open. In my opinion, the developers of AdGuardHome should consider what the user lists inside the .yaml file to be taken as priority over what is mentioned in the adguardhome launching command line arguments. Obviously if the user has gone out of their way to specify a location inside the .yaml file as the log file, then that should always have priority. I hope you understand I have no control over this behavior without making those who rely on syslog to show log behaviors, blind to what is happening with the operation of their individual AdGuardHome instance.