Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

wildcard expansion for multiple files in config

  • Loading branch information...
commit 796da2b025d926f6d3273b7892e6dd7bfbbc8479 1 parent 1c249ee
Richard Jones authored

Showing 3 changed files with 39 additions and 6 deletions. Show diff stats Hide diff stats

  1. +23 5 README.md
  2. +4 0 priv/index.html
  3. +12 1 src/logtail_mgr.erl
28 README.md
Source Rendered
... ... @@ -1,10 +1,28 @@
1   -## logtail
  1 +## logtail: tail -f logfiles in the browser with websockets
2 2
3   -NB: incomplete hack!
4   -
5   -tail -f logfiles in browser using websockets
  3 +*NB: incomplete hack!*
6 4
  5 +### How to build and run
  6 +```
7 7 $ rebar get-deps
8 8 $ ./start-dev.sh
  9 +```
  10 +
  11 +Now visit http://localhost:9090/index.html
  12 +
  13 +(still need to make cowboy treat / as /index.html)
  14 +
  15 +### Configuration
  16 +
  17 +Add entries to the sources section in app.config:
  18 +
  19 +*Single file*
  20 +```
  21 +{file, "/path/to/file.log", []}
  22 +```
  23 +
  24 +*Multiple files, wildcard expansion*
  25 +```
  26 +{files, "/var/log/*", []}
  27 +```
9 28
10   -http://localhost:9090/index.html (still need to make cowboy treat / as /index.html)
4 priv/index.html
@@ -134,6 +134,10 @@
134 134 padding: 1em;
135 135 }
136 136
  137 +div.source {
  138 + font-weight: bold;
  139 +}
  140 +
137 141 @media screen
138 142 {
139 143 body>div#fixedbox
13 src/logtail_mgr.erl
@@ -165,4 +165,15 @@ start_tailer({file, Path, Opts}) when is_list(Path), is_list(Opts) ->
165 165 _ ->
166 166 lager:info("starting tailer for {file, ~s}", [Path]),
167 167 supervisor:start_child(logtail_tailer_sup, [{file, Path, Opts}])
168   - end.
  168 + end;
  169 +
  170 +start_tailer({files, Path}) ->
  171 + start_tailer({files, Path, []});
  172 +
  173 +start_tailer({files, Path, Opts}) when is_list(Path), is_list(Opts) ->
  174 + lists:foreach(fun(P) ->
  175 + start_tailer({file, P, Opts})
  176 + end, filelib:wildcard(Path)).
  177 +
  178 +
  179 +

0 comments on commit 796da2b

Please sign in to comment.
Something went wrong with that request. Please try again.