Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

wildcard expansion for multiple files in config

  • Loading branch information...
commit 796da2b025d926f6d3273b7892e6dd7bfbbc8479 1 parent 1c249ee
@RJ authored
Showing with 39 additions and 6 deletions.
  1. +23 −5 README.md
  2. +4 −0 priv/index.html
  3. +12 −1 src/logtail_mgr.erl
View
28 README.md
@@ -1,10 +1,28 @@
-## logtail
+## logtail: tail -f logfiles in the browser with websockets
-NB: incomplete hack!
-
-tail -f logfiles in browser using websockets
+*NB: incomplete hack!*
+### How to build and run
+```
$ rebar get-deps
$ ./start-dev.sh
+```
+
+Now visit http://localhost:9090/index.html
+
+(still need to make cowboy treat / as /index.html)
+
+### Configuration
+
+Add entries to the sources section in app.config:
+
+*Single file*
+```
+{file, "/path/to/file.log", []}
+```
+
+*Multiple files, wildcard expansion*
+```
+{files, "/var/log/*", []}
+```
-http://localhost:9090/index.html (still need to make cowboy treat / as /index.html)
View
4 priv/index.html
@@ -134,6 +134,10 @@
padding: 1em;
}
+div.source {
+ font-weight: bold;
+}
+
@media screen
{
body>div#fixedbox
View
13 src/logtail_mgr.erl
@@ -165,4 +165,15 @@ start_tailer({file, Path, Opts}) when is_list(Path), is_list(Opts) ->
_ ->
lager:info("starting tailer for {file, ~s}", [Path]),
supervisor:start_child(logtail_tailer_sup, [{file, Path, Opts}])
- end.
+ end;
+
+start_tailer({files, Path}) ->
+ start_tailer({files, Path, []});
+
+start_tailer({files, Path, Opts}) when is_list(Path), is_list(Opts) ->
+ lists:foreach(fun(P) ->
+ start_tailer({file, P, Opts})
+ end, filelib:wildcard(Path)).
+
+
+
Please sign in to comment.
Something went wrong with that request. Please try again.