Skip to content

Commit bed5c86

Browse files
committed
misc
1 parent fb11858 commit bed5c86

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

scouterx/conf/configure.go

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,18 @@ func (conf *Configure) run() {
140140
}
141141

142142
func getConfFilePath() string {
143-
path := util.GetScouterPath()
144-
confPath := filepath.Join(path, "conf")
145-
util.MakeDir(confPath)
146-
return filepath.Join(path, "conf", "scouter.conf")
143+
scouterConfFile := os.Getenv("SCOUTER_CONFIG")
144+
if scouterConfFile == "" {
145+
scouterConfFile = os.Getenv("scouter.config")
146+
}
147+
if scouterConfFile == "" {
148+
path := util.GetScouterPath()
149+
confPath := filepath.Join(path, "conf")
150+
util.MakeDir(confPath)
151+
scouterConfFile = filepath.Join(path, "conf", "scouter.conf")
152+
}
153+
154+
return scouterConfFile
147155
}
148156

149157
func (conf *Configure) SetTrace(mode bool) {

0 commit comments

Comments
 (0)