Skip to content

Commit

Permalink
#44 support wildcard globs in logs config
Browse files Browse the repository at this point in the history
  • Loading branch information
jdrews committed Apr 1, 2023
1 parent 4644f02 commit 8a612b5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions logstation.default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,19 @@
# logstaion config file
# https://github.com/jdrews/logstation

# List of log files to tail
# The list can be single log files or a wildcard glob to pick up
# all files in a directory or rotating log files
# Windows example of setting up logs
logs = [
'e:\git\logstation\test\logfile.log',
'e:\git\logstation\test\with space\logfile.log',
'e:\git\logstation\test\logfile2.log'
'e:\git\logstation\test\*.log'
]
# Unix example of setting up logs
#logs = [
# '/home/jdrews/git/logstation/logfile.log',
# '/home/jdrews/git/logstation/logfile2.log'
# '/home/jdrews/git/logstation/*.log'
#]

# Unique name for logstation instance
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ func follow(logFilePath string, pubSub *pubsub.PubSub, patterns []CompiledRegexC
tailer, err := fswatcher.RunFileTailer([]glob.Glob{parsedGlob}, false, true, logger)
for line := range tailer.Lines() {
logger.Debug(line.Line)
logMessage := colorize(line.Line, logFilePath, patterns)
logMessage := colorize(line.Line, line.File, patterns)
pubSub.Pub(logMessage, "lines")
}

Expand Down

0 comments on commit 8a612b5

Please sign in to comment.