@ -45,6 +45,7 @@ type backend struct {
lastDNSCfg * dns . OSConfig
lastDNSCfg * dns . OSConfig
logIDPublic string
logIDPublic string
logger * logtail . Logger
// avoidEmptyDNS controls whether to use fallback nameservers
// avoidEmptyDNS controls whether to use fallback nameservers
// when no nameservers are provided by Tailscale.
// when no nameservers are provided by Tailscale.
@ -152,6 +153,9 @@ func newBackend(dataDir string, jvm *jni.JVM, appCtx jni.Object, store *stateSto
if err := ns . Start ( lb ) ; err != nil {
if err := ns . Start ( lb ) ; err != nil {
return nil , fmt . Errorf ( "startNetstack: %w" , err )
return nil , fmt . Errorf ( "startNetstack: %w" , err )
}
}
if b . logger != nil {
lb . SetLogFlusher ( b . logger . StartFlush )
}
b . engine = engine
b . engine = engine
b . backend = lb
b . backend = lb
return b , nil
return b , nil
@ -343,10 +347,10 @@ func (b *backend) SetupLogs(logDir string, logID logid.PrivateID) {
}
}
logf := logger . RusagePrefixLog ( log . Printf )
logf := logger . RusagePrefixLog ( log . Printf )
tlog : = logtail . NewLogger ( logcfg , logf )
b. logger = logtail . NewLogger ( logcfg , logf )
log . SetFlags ( 0 )
log . SetFlags ( 0 )
log . SetOutput ( tlog )
log . SetOutput ( b. logger )
log . Printf ( "goSetupLogs: success" )
log . Printf ( "goSetupLogs: success" )