Skip to content

Commit 3864092

Browse files
committed
Merge branch 'develop'
2 parents 2f24c5f + f3f7608 commit 3864092

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

.goreleaser.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ changelog:
2525
exclude:
2626
- '^docs:'
2727
- '^test:'
28+
- '^Merge pull request'
29+
- '^Merge branch'
2830
release:
2931
github:
3032
owner: hyeoksuhan

cmd/cmd_eblogs.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ import (
2222
)
2323

2424
type target struct {
25-
logPath string
25+
logPath []string
2626
ids []string
2727
}
2828

2929
type streamlogsInput struct {
3030
service gossm.SSMservice
3131
instanceID string
32-
logPath string
32+
logPath []string
3333
grepOpt grepOpt
3434
colorf func(...interface{}) string
3535
}
@@ -212,8 +212,10 @@ func streamlogs(ctx context.Context, wg *sync.WaitGroup, input streamlogsInput)
212212

213213
sshCommand := []string{
214214
"tail",
215-
"-f",
216-
input.logPath,
215+
}
216+
217+
for _, p := range input.logPath {
218+
sshCommand = append(sshCommand, "-F", p)
217219
}
218220

219221
args := append(sshArgs, sshCommand...)

service/goeb/eb.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ type EBservice struct {
1313
ebInstance *eb.ElasticBeanstalk
1414
EnvNames []string
1515
envStackMap map[string]string
16-
envPathMap map[string]string
16+
envPathMap map[string][]string
1717
}
1818

1919
// New creates new EBservice
@@ -29,9 +29,9 @@ func New(sess *session.Session) (instance EBservice, err error) {
2929
ebInstance: svc,
3030
EnvNames: []string{},
3131
envStackMap: make(map[string]string),
32-
envPathMap: map[string]string{
33-
"node.js": "/var/log/nodejs/nodejs.log",
34-
"java": "/var/log/web-1.log",
32+
envPathMap: map[string][]string{
33+
"node.js": []string{"/var/log/nodejs/nodejs.log"},
34+
"java": []string{"/var/log/web-1.log", "/var/log/web-1.error.log"},
3535
},
3636
}
3737

@@ -84,7 +84,7 @@ func (svc EBservice) getStackName(envName string) string {
8484
}
8585

8686
// GetLogPath returns app log path matched with platform
87-
func (svc EBservice) GetLogPath(envName string) string {
87+
func (svc EBservice) GetLogPath(envName string) []string {
8888
stackName := svc.getStackName(envName)
8989

9090
for k, v := range svc.envPathMap {
@@ -93,5 +93,5 @@ func (svc EBservice) GetLogPath(envName string) string {
9393
}
9494
}
9595

96-
return ""
96+
return []string{}
9797
}

0 commit comments

Comments
 (0)