@@ -970,21 +970,20 @@ func collectLogs(done <-chan struct{}, params dto.StreamLog, messageChan chan<-
970970
971971 var dockerCmd * exec.Cmd
972972 if params .Type == "compose" {
973- dockerComposCmd := common .GetDockerComposeCommand ()
973+ dockerComposeCmd := common .GetDockerComposeCommand ()
974974 var yamlFiles []string
975975 for _ , item := range strings .Split (params .Compose , "," ) {
976976 if len (item ) != 0 {
977977 yamlFiles = append (yamlFiles , "-f" , item )
978978 }
979979 }
980- if dockerComposCmd == "docker-compose" {
980+ if dockerComposeCmd == "docker-compose" {
981981 newCmdArgs := append (yamlFiles , cmdArgs ... )
982- dockerCmd = exec .Command (dockerComposCmd , newCmdArgs ... )
982+ dockerCmd = exec .Command (dockerComposeCmd , newCmdArgs ... )
983983 } else {
984984 newCmdArgs := append (append ([]string {"compose" }, yamlFiles ... ), cmdArgs ... )
985985 dockerCmd = exec .Command ("docker" , newCmdArgs ... )
986986 }
987- global .LOG .Debug ("Docker command:" , dockerCmd .Args )
988987 } else {
989988 dockerCmd = exec .Command ("docker" , cmdArgs ... )
990989 }
@@ -1062,10 +1061,16 @@ func (u *ContainerService) DownloadContainerLogs(containerType, container, since
10621061 commandArg := []string {"logs" , container }
10631062 dockerCommand := global .CONF .DockerConfig .Command
10641063 if containerType == "compose" {
1064+ var yamlFiles []string
1065+ for _ , item := range strings .Split (container , "," ) {
1066+ if len (item ) != 0 {
1067+ yamlFiles = append (yamlFiles , "-f" , item )
1068+ }
1069+ }
10651070 if dockerCommand == "docker-compose" {
1066- commandArg = [] string { "-f" , container , "logs" }
1071+ commandArg = append ( yamlFiles , "logs" )
10671072 } else {
1068- commandArg = []string {"compose" , "-f" , container , "logs" }
1073+ commandArg = append ( append ( []string {"compose" }, yamlFiles ... ), "logs" )
10691074 }
10701075 }
10711076
0 commit comments