"os"
- common "gerrit.automotivelinux.org/gerrit/src/xds/xds-common.git/golib"
+ common "gerrit.automotivelinux.org/gerrit/src/xds/xds-common.git"
"github.com/Sirupsen/logrus"
uuid "github.com/satori/go.uuid"
"github.com/urfave/cli"
// Handle where Logs are redirected:
// default 'stdout' (logfile option default value)
// else use file (or filepath) set by --logfile option
- // that may be overwritten by LogsDir field of config file
+ // else use LogsDir field of config file
logF := c.Options.LogFile
logD := c.FileConf.LogsDir
if logF != "stdout" {
- if logD != "" {
+ if logF != "" {
+ if common.IsDir(logF) {
+ logD = logF
+ logF = filepath.Join(logF, "xds-agent.log")
+ } else {
+ logD = filepath.Dir(logF)
+ }
+ } else if logD != "" {
lf := filepath.Base(logF)
if lf == "" || lf == "." {
lf = "xds-agent.log"