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:
parent
2a23abbcbd
commit
f428da55c8
@ -40,20 +40,8 @@ func main() {
|
|||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
if configuration.LogPath == "" {
|
// Init log settings
|
||||||
configuration.LogPath = "./godns.log"
|
log.SetPrefix("【GoDNS】")
|
||||||
}
|
|
||||||
|
|
||||||
// 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)
|
|
||||||
log.Println("GoDNS started, entering main loop...")
|
log.Println("GoDNS started, entering main loop...")
|
||||||
dnsLoop()
|
dnsLoop()
|
||||||
}
|
}
|
||||||
|
@ -3,16 +3,23 @@
|
|||||||
"email": "example@gmail.com",
|
"email": "example@gmail.com",
|
||||||
"password": "",
|
"password": "",
|
||||||
"login_token": "",
|
"login_token": "",
|
||||||
"domains": [{
|
"domains": [
|
||||||
|
{
|
||||||
"domain_name": "example.com",
|
"domain_name": "example.com",
|
||||||
"sub_domains": ["www","test"]
|
"sub_domains": [
|
||||||
},{
|
"www",
|
||||||
|
"test"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
"domain_name": "example2.com",
|
"domain_name": "example2.com",
|
||||||
"sub_domains": ["www","test"]
|
"sub_domains": [
|
||||||
|
"www",
|
||||||
|
"test"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"ip_url": "http://members.3322.org/dyndns/getip",
|
"ip_url": "http://members.3322.org/dyndns/getip",
|
||||||
"log_path": "./godns.log",
|
|
||||||
"socks5_proxy": "",
|
"socks5_proxy": "",
|
||||||
"notify": {
|
"notify": {
|
||||||
"enabled": false,
|
"enabled": false,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user