1
0
mirror of https://github.com/taigrr/godns synced 2025-01-18 04:03:25 -08:00

use stdout as default log output.

This commit is contained in:
Timothy Ye 2018-04-17 20:42:17 +08:00
parent 2a23abbcbd
commit f428da55c8
2 changed files with 24 additions and 29 deletions

View File

@ -40,20 +40,8 @@ func main() {
os.Exit(1)
}
if configuration.LogPath == "" {
configuration.LogPath = "./godns.log"
}
// Init log file
f, err := os.OpenFile(configuration.LogPath, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
if err != nil {
fmt.Println("Failed to create log file:", configuration.LogPath)
os.Exit(1)
}
defer f.Close()
log.SetOutput(f)
// Init log settings
log.SetPrefix("【GoDNS】")
log.Println("GoDNS started, entering main loop...")
dnsLoop()
}

View File

@ -1,25 +1,32 @@
{
"provider": "DNSPod",
"provider": "DNSPod",
"email": "example@gmail.com",
"password": "",
"login_token": "",
"domains": [{
"domains": [
{
"domain_name": "example.com",
"sub_domains": ["www","test"]
},{
"sub_domains": [
"www",
"test"
]
},
{
"domain_name": "example2.com",
"sub_domains": ["www","test"]
"sub_domains": [
"www",
"test"
]
}
],
"ip_url": "http://members.3322.org/dyndns/getip",
"log_path": "./godns.log",
"socks5_proxy": "",
"notify": {
"enabled": false,
"smtp_server": "",
"smtp_username": "",
"smtp_password": "",
"smtp_port": 25,
"send_to": ""
}
}
"notify": {
"enabled": false,
"smtp_server": "",
"smtp_username": "",
"smtp_password": "",
"smtp_port": 25,
"send_to": ""
}
}